Remove the extra item
Last in, first out
Remove the extra item
Goal
Change [2, 5] into [2]. Only the top can be removed.
Preview board
Not runAdd instructions, then run your pseudocode.
Pseudocode
0 / 1 instructionsReady to run.
How it works
Last in, first out
Manipulate the top of a stack without treating it as an array.
Key rule
The top value is TOP. PUSH adds a value, POP removes TOP, DUPLICATE copies TOP, and SWAP exchanges the top two. Capacity is six.
Worked example
Different example: [2,5] becomes [2] after POP; PUSH(7) then gives [2,7]. Popping an empty stack is invalid.
Win condition
Complete the pseudocode and concept check.
Show a hint
POP removes TOP. The bottom stays in place.
Edit text
Enter one instruction per line. You can use the displayed pseudocode or commands from the reference.