Min Stack

Problem:

Design a stack that supports push, pop, top, and retrieving the minimum element in constant time O(1).

Examples:

					
MinStack minStack = new MinStack();
minStack.push(-2);
minStack.push(0);
minStack.push(-3);
minStack.getMin();   --> Returns -3.
minStack.pop();
minStack.peek();      --> Returns 0.
minStack.getMin();   --> Returns -2.
				

Hints and Answer Checklist