StackEvidence Contributing
Monotonic Deque
Maintain a double-ended queue of candidate indices in monotonic order to answer sliding-window max/min in O(1) amortized.
Practice Problems: 2
Difficulty: 0 Easy·1 Medium·1 Hard
Core technique
Review the technique, then try the mapped problems below. The right approach depends on each problem's constraints.
- Core Strategy: Maintain a double-ended queue of candidate indices in monotonic order to answer sliding-window max/min in O(1) amortized.