# puzzle gauntlet advanced

The Emoji Stack Machine

You found an alien computer. Its entire language: PUSH, POP, ADD, PRINT. Turns out you speak fluent alien. 👾

You get the program — commands PUSH:n, POP (discard top), ADD (pop two, push their sum), PRINT (print the top, keeping it). All commands are valid when they run. Execute the program.

Example:

Input: program = ["PUSH:3", "PUSH:4", "ADD", "PRINT"] Output: 7

Pushing 3 then 4, ADD pops both and pushes their sum 7, and PRINT shows the top without removing it.

💡 need a hint?

pg-emoji-stack-machine.py🔒 given lines are locked — write your code in between
loading...