Prateek Sir and Coding

The code is giving run time error in all 3 test cases but running fine on compilation.Pls help.Code:

In the question it is given that If the pile is empty, print “No Code” (without the quotes).
Also before popping an element or to access the top element of a stack, you need to check that the stack is empty or not. If the stack was empty and still you have popped an element, then this will give runtime error.