Back to QuestionsPractice with This Question
Implement a Min Stack
101.2K views•Asked at Apple•
Medium
Question Explain
Design a stack that supports push, pop, top, and retrieving the minimum element in $O(1)$ time. This requires using auxiliary storage with the main stack.
Start Trying This Question Simulation
Practice answering orally or with text to get instant AI feedback.