Variable sliding window
mediumThe 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 alphabetLoading the variable sliding window engine…