Adityaxv's blog

By Adityaxv, 20 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

| Write comment?
»
20 months ago, hide # |
 
Vote: I like it -8 Vote: I do not like it

I think it's easier to solve using a Trie

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

You missed the non-overlapping constraint.