Algorithm · Okx · Easy
Design a stack that, in addition to the usual push and pop operations, can efficiently report the smallest element currently stored. Implement the following commands: push x: appends the integer x to the top of the stack. pop: removes the element at the top. Report the removed value. If the stack contains no elements, report EMPTY. top: reports the value at the top without removing it. If the stack is empty, report EMPTY. min: reports the minimum value among all elements…