Min Stack at Snapchat
Medium57.7% acceptance
This problem has 87.5% frequency at Snapchat.
Problem Description
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. Implement the `MinStack` class: * `MinStack()` initializes the stack object. * `void push(int val)` pushes the element `val` onto the stack. * `void pop()` removes the element on the top of the...
Read full problem and hintsTopics
Also asked at 35 companies
More Snapchat Questions
LRU CacheMediumBasic Calculator IIMediumRemove K DigitsMediumMinimum Remove to Make Valid ParenthesesMediumInsert Delete GetRandom O(1)Medium
View all Snapchat questions