Concept Flow - Min Stack Design
Push x
Push x to main stack
Is min stack empty or x <= top of min stack?
No→Do nothing
Yes
Push x to min stack
Done
Pop
Pop from main stack
Is popped value == top of min stack?
No→Do nothing
Yes
Pop from min stack
Done
GetMin
Return top of min stack
Push adds to main stack and min stack if needed; Pop removes from both if top matches; GetMin returns min stack top.
