Algorithm · Okx · Easy
Stack with Minimum Query Easy · Topics · Company Tags · Hints 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. Print the removed value. If the stack contains no elements, print EMPTY. top: prints the value at the top without removing it. If the stack is empty, print…
Checking your access…