Why you are complicating things.
This is my code Link
Hope so it’s understandable.
In line 47 you are doing chaining comparison:
(((a[x] == a[x + 1] == a[x - 1])))
As far as i know it is not allowed in C++, We have to do this instead:
(((a[x] == a[x + 1] && a[x] == a[x - 1])))
AC using your code and changing 1 line: Link
oh shit. I’ve lost my 65 points just because of that
btw thank you I was getting mad as i didn’t knew where I was going wrong.
Tq like It was solution I wrote during live contest. So I was considering all cases.