Design a stack that supports push, pop, top, and getMin in O(1) time.
MinStack β push(-2) β push(0) β push(-3) β getMin()β-3 β pop() β top()β0 β getMin()β-2
Unlock hints progressively β start gentle, go deeper only if needed.
Level 1: Gentle Nudge
A subtle direction
Level 2: Approach
The algorithm to use
Level 3: Detailed
Step-by-step guidance
to save progress and use AI features