Concept Flow - Min Stack Design
Push x
Push x to main stack
Compare x with current min
Yes No
Push x to min stack
Done
Done
Pop
Pop from main stack
Pop from min stack
Done
GetMin
Return top of min stack
Done
When pushing, add element to main stack and update min stack with new min. When popping, remove from both stacks. GetMin returns top of min stack.
