Sliding windowIntro

Data structures & algorithms · lesson 4

A window that slides.

Last lesson, two pointers moved toward each other. This time they move the same way, holding a window between them that slides across the list. It turns a lot of repeated adding into almost none.

Any “best run of k in a row” problem.

Tap Start.

Quick, honest: how does this feel right now?