Topics / Sliding Window
🪟
Sliding Window
A moving window over a sequence — fixed and variable size, with O(n) substring and subarray solutions.
Why learn Sliding Window?
-
Solves nearly every "longest / shortest substring with property X" problem.
-
Pairs perfectly with hash maps and deques.
-
Once internalized, you spot it in three problems out of five.
What you can build with Sliding Window
Longest substring with K distinct characters Fixed-size subarray problems Minimum-window / minimum-cover problems
Sliding Window tutorials
1 article · page 1 of 1Hand-written tutorials, ordered as a recommended learning path.