Compilers and Parsers WA

Hey I have tried to run my code on a number of test cases. It seems to be fine. But i am getting WA. Can anyone please help?
https://www.codechef.com/viewsolution/32388896

Try this test case…
2
<<<><<
<<>><<<>><>

Answer should be :
0
4

But your answer is :
2
10

I tried and this also giving wrong answer
CodeChef: Practical coding for everyone, can you tell which test case failing this.

Hint: you probably won’t start finding errors until the length of the string is 128 or so.

2 Likes