A stack problem

sir my code is not working in the last sample case. i am not able to find the error, please tell me . the question and code are inside the link

link -> https://sapphireengine.com/@/6qvvjp