CodeMosa

Master LeetCode Patterns

Back
Min/Max Stack/Queue
Question 1 of 128% Complete
Medium
How do you implement a stack that supports getMin() in O(1)?
Need a hint?
Think about tracking minimums alongside values