IMstuNNing's blog

By IMstuNNing, history, 2 years ago, In English
  • Vote: I like it
  • +3
  • Vote: I do not like it

| Write comment?
»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

dpA[i] =dpA[i-1] + (s[i]=='A') * numofQ[1,i-1]
dpQ[i]= dpQ[i-1] + (s[i]=='Q') * dpA[i-1]

final answer is dpQ[n]

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it