Sliding Window (Fixed Window)
ProUse when the window size is constant (exactly k) and you need the best value over all length-k windows.
Keywords for identifying Fixed Window Problems
→ “subarray of size k”
→ “exactly k elements”
→ “moving average”
→ “fixed length window”
Unlock the Sliding Window (Fixed Window) template
Get the full code template and worked LeetCode examples for Sliding Window (Fixed Window) — plus every other pattern in the library — with a one-time $29 lifetime upgrade.
Upgrade to ProSee free Binary Search template →