Tag: Min Stack

  • LeetCode: 155 Min Stack

    LeetCode: 155 Min Stack Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) — Pushes element x onto the stack. pop() — Removes the element on the top of the stack. top() — Gets the top element. getMin() — Retrieves the minimum…