Day 24 — Sliding Window
This chapter is being written. Check back soon!
What you’ll learn here
- Fixed-size windows — max sum of size k, average of last n elements, anagrams
- Variable-size windows — longest substring without repeating, minimum window substring
- The expand/contract template that solves most of them in ~10 lines
- Common pitfalls: forgetting to update the answer when contracting, off-by-one with right pointer
You already met sliding window in Sliding Window Maximum and Number of Recent Calls. This chapter formalizes the pattern.