Pattern 22: LeetCode Interview Patterns24 sections · 736 units
Open in CourseQuiz: Tracking Minimum in O(1)
Test your understanding
Check Your Understanding
To get the minimum element in O(1) as elements are pushed and popped, what should you track?
- A.The minimum value at each stack level
- B.Just the current minimum value
- C.A sorted list of all elements
- D.The index of the minimum element