Sliding Window
Fixed and elastic windows over arrays and strings, plus the monotonic deque for window maximums.
0 of 7 lessons complete · 138 min total
- Windows: Fixed vs Grow-and-ShrinkThe two flavors — exactly-k windows and longest/shortest valid windows — and the monotone-condition requirement that makes shrinking safe.Lesson · 16 minNot completed
- The Fixed Window SlideConstant-size windows updated in O(1) per step.Animation · 9 minNot completed
- The Elastic WindowExpand until invalid, shrink until valid — made visceral.Animation · 10 minNot completed
- Monotonic Deque: Window Max in O(n)Why a deque of falling values answers every window's max instantly.Animation · 10 minNot completed
- Practice: Longest Valid WindowsOne-pass min tracking and the grow-and-shrink rhythm.easymedium×23 problems · 0 solvedPractice · 40 minNot completed
- Practice: Counted Windows & DequesFrequency-matched windows, the need-vs-have minimum window, and the deque-powered maximum.mediumhard×23 problems · 0 solvedPractice · 45 minNot completed
- Sliding Window CheckpointFixed vs variable windows, monotone conditions, and when a deque replaces a heap.Checkpoint · 8 minNot completed