Please read the new rule regarding the restriction on the use of AI tools. ×

IMstuNNing's blog

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

| Write comment?
»
23 months 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]

»
23 months ago, # |
  Vote: I like it 0 Vote: I do not like it