Skip to main content

Checkpoint: The Amnesiac Stack

Challenge on lesson: Checkpoint — The Amnesiac Stack

CHALLENGE
Difficulty: advanced+25 XP

**Task.** Process a stack protocol: 1 x pushes x; 2 pops the top (popping an empty stack does nothing); 3 prints the current minimum of the stack, or −1 if empty. **Constraints:** 1 ≤ number of operations ≤ 200000; 0 ≤ x < 10^9. Every 3 prints on its own line. **Think:** this is the stress-harness module — mentally simulate the pop-heavy test below twice before submitting.

Back to lesson: Checkpoint — The Amnesiac Stack