Wrong answer in prateek sir and coding

my code is https://ide.codingblocks.com/s/113226
all the test cases are showing wrong answer ,please tell the reason… I simply took integers. and if its 2 took input of other value, else displayed the top.

When there is no value in the stack print “No Code” as given in the question you are printing -1