Understanding the Sliding Window Technique in Algorithms

Annie Liao
Level Up Coding
Published in
3 min readSep 29, 2020

--

Photo by R Mo on Unsplash

Aside from the two-pointer technique demonstrated in my previous post, I have been grokking another popular algorithmic mental model: the sliding window.

If you have never heard of the sliding-window technique, I strongly recommend watching this video tutorial before diving into the example below. Even if you don’t have 36 minutes to spare, be sure to watch the first…

--

--

Fullstack Developer: React with Rails. Currently exploring data structures, D3 visualization, and other front-end magic.