← Questions

Min stack

0
AnthropicCodingLast asked Feb 2026

Design a stack that supports push, pop, top and returning the current minimum element, each in constant time. Explain how the minimum stays correct after pops, how you handle duplicate minimum values, and the extra memory your design uses.

Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding