Submit and pass all tests to enable saving to GitHub.
Implementation
Read an integer N (number of commands), then N commands, each either:
"push X" (X is an integer)
"pop"
After processing all commands, print the value on top of the stack, or "empty" if the stack is empty. Inputs never pop from an empty stack.
Why This Matters
The exact array-plus-top-index structure you build here is CPython's value stack in its frame objects and the JVM's operand stack that the bytecode verifier statically checks. WebAssembly validation is essentially a proof about this data structure's depth at every instruction.