Min Stack — a second stack for the minimum
Alongside the values, keep a parallel stack whose top is always the minimum so far. Because they push and pop together, the current minimum is one lookup away.
Try:
stack
min_stack