Concept Flow - Min Stack Design
Push x
Push x on main stack
Compare x with current min
Push x on min stack
Do nothing on min stack
Done
Pop
Pop from main stack
Compare popped value with min stack top
Pop from min stack
Do nothing
Done
GetMin
Return top of min stack
Done
When pushing, add to main stack and update min stack if needed. When popping, remove from main stack and min stack if top matches. GetMin returns top of min stack.
