Please, try EDU on Codeforces! New educational section with videos, subtitles, texts, and problems. ×

Lakh's blog

By Lakh, history, 10 months ago, In English,

I am trying the following problem: I am using persistent trie to solve this problem by creating new version of trie for each add operation. For query, I am retrieving prefix count of query string from Rth version of trie and subtracting from this the prefix count from (L-1)th version. But my approach is giving WA. I also went through the editorial but it is not much understandable. So please suggest some other approaches for this problem using trie or some other data structure.

  • Vote: I like it
  • 0
  • Vote: I do not like it