Brackets Balance

Hi All,
Can any one help me where I am wrong in checking number of pairs of bracket are in correct order.
Question Link:COMPILER Problem - CodeChef
My submission link:CodeChef: Practical coding for everyone

Where’s the question link dude??

Link is present now…

Please either format your code or (better!) link to your submission - the forum software has mangled it and it won’t compile! :slight_smile:

Whenever the stack is empty and you try to access A.top(), you will get a segementation fault due to the undefined behavior of stack.top().
For example : “<<>><>><” will give RTE.

Thank you bro.