SPOJ [ BRCKTS — Brackets ] problem.

Problem Link- link

I am getting WA on this question can’t figure it out where I am going wrong. I tested many cases in which my code is passing correctly :(. Please help me to get rid of this problem.

My solution- link

According to your solution link, you’re getting “Time limit exceeded”, not WA. Totally different issue to work.