mayank.nichlani22's blog

By mayank.nichlani22, history, 3 hours ago, In English

This was my BS code 280037349 and This is my code using monotonic stack approach 280042055.Still both of them fail on a hidden testcase.Can anyone help me regarding this?

»
3 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

I didn't get why your code fails

»
3 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

skill issue mate

»
3 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by mayank.nichlani22 (previous revision, new revision, compare).

»
51 minute(s) ago, # |
  Vote: I like it +1 Vote: I do not like it

in the following test case

1
3 1
BG GR RY
1 3

your code outputs -1 while AC code returns 2.