Workspace

Sliding Window

3 day streakD
All algorithms

Sliding window algorithms.

Move the boundaries, maintain the invariant, then put it into code.

15 lessons · Python & C++

Fixed windows

Longest windows

Smallest windows

ProblemDifficultyTime complexityPractice
Minimum Size Subarray SumMediumO(n)LeetCode
Minimum Window SubstringHardO(n + m)LeetCode

Counting windows

Monotonic deque

ProblemDifficultyTime complexityPractice
Sliding Window MaximumHardO(n)LeetCode

A good place to start

Explore a pattern

A little guidance

Start with a pattern, read through a problem, and mark it solved when the idea clicks. Save anything you want to revisit.

New tutorials are added one at a time. Your bookmarks and solved checkmarks stay in this browser.

Explore the roadmap