Adityaxv's blog

By Adityaxv, 2 months ago, In English

Problem

My Solution

1964/2028 test cases have been accepted. Below is one of the test cases in which my code gives a wrong output:

Testcase
  • Vote: I like it
  • -1
  • Vote: I do not like it

»
2 months ago, # |
  Vote: I like it -8 Vote: I do not like it

I think it's easier to solve using a Trie

»
2 months ago, # |
  Vote: I like it +1 Vote: I do not like it

You missed the non-overlapping constraint.