...

/

Challenge 9: min() Function Using a Stack

Challenge 9: min() Function Using a Stack

Using your knowledge, create an efficient "min()" function using a stack.

Problem statement

You have to implement the minStack class, which will have a min() function. Whenever min() is called, the minimum value of the stack is returned in O(1) ...