0

Sliding Window

A contiguous range that grows on the right and shrinks on the left while a condition holds.

Newinterview weight 8012 problems2 visualisers
18
mastery
Attempts logged
0
Predicted success on the next one
33%
Solved here
0 / 12

What you actually need to hold in your head

  • Fixed size versus variable size windows
  • Shrink while invalid, record while valid
  • Monotonic deque for window extrema
  • At most K minus at most K-1 gives exactly K

Watch it run

Step through the algorithm before you write it.

Patterns in this topic

The trigger phrases are what you are training yourself to notice.

Sliding Window problems

Ordered by sheet phase, so the early ones are the highest signal.

0 / 12 solved
1
2
3
4
HSliding Window
5
6
7
8
MSliding Window
9
MSliding Window
10
11
HSliding Window
12