Windows apply to neighboring values, characters, or events in one ordered stream.
Sliding Window
4 chapters · 9 challenges · The Glass Canyon
Understand the idea, practise through play, then prove it in code. Choose your next quest below.
Visual introduction to this topic
What is a sliding window?
A sliding window maintains information about one contiguous region while its boundaries move. Instead of recomputing the region from scratch, it updates only what entered and what left.
Think of a moving camera frame. The camera sees one part of a long parade. As it moves, one performer exits and another enters; everything in the middle stays known.
Expand, update, and shrink while keeping the window rule true.
Update a sum, count, set, deque, or frequency map at each boundary move.
Variable windows contract until the required condition becomes true again.
Move a sum without rebuilding it
Fixed Window
0/2 completePractice fixed window through 2 visual expeditions.
Variable Window
0/2 completePractice variable window through 2 visual expeditions.
Frequency Window
0/3 completePractice frequency window through 3 visual expeditions.
Monotonic Window
0/2 completePractice monotonic window through 2 visual expeditions.
Built from authoritative material
This track is checked against the sources below. Visual traces still carry their own complete or guided coverage label, so unfinished explanations are not presented as complete executions.