Help needed, and can someone explain my error

please help, whats the error

https://www.codechef.com/viewsolution/34850383

In the while loop(in the else block) put an extra condition that while the stack is not empty.

https://www.codechef.com/viewsolution/34851454

now wrong answer
:frowning:

I didn’t check the logic! I just checked for the RE.