Variable sliding window

medium

The longest substring without repeats, in one pass. Neither pointer ever reverses, so together they take at most 2n steps even though the window itself grows and shrinks unpredictably.

Worst O(n)Space O(k) for the alphabet
Loading the variable sliding window engine…

Where to go next