8. Sliding Window
Fixed and variable windows over arrays and strings.
π¬ Episode 10: video coming soon
Your progress0 of 14
2easy
10medium
2hard
Understand the topic
A sliding window is a frame over a contiguous part of an array or string. Instead of recomputing every subarray, you add the element that enters and remove the one that leaves.
Fixed windows keep the same size (k). Variable windows grow on the right and shrink from the left while a rule is broken. For "exactly K" questions, compute atMost(K) - atMost(K - 1).
Nothing matches that filter.
Work top to bottom β each list goes from easy to hard. Try a problem for at least 15 minutes before opening a hint. Ticks are saved in your browser.