Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
getMin() -- Retrieve the minimum element in the stack.
Show Tags Stack Data Structure
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
getMin() -- Retrieve the minimum element in the stack.
Show Tags Stack Data Structure