Prompt
Implement a MinMaxStack class that works like a regular stack but also lets you retrieve the current minimum and maximum values at any time, without removing anything.
Your class should support:
push(number)— adds a number to the toppop()— removes and returns the top numberpeek()— returns the top number without removing itisEmpty()— returnstrueif the stack is emptygetMin()— returns the smallest number currently in the stackgetMax()— returns the largest number currently in the stack
getMin() and getMax() must work in constant time (no looping through the whole stack).