Skip to content
Codeloom

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 1

Hand-written tutorials, ordered as a recommended learning path.

  1. 01 Sliding Window Master the sliding window technique with fixed and variable window patterns, two pointer variants, and reusable templates for solving LeetCode problems.