VISUALGO//POINTERS
variable window · two-pointer trace console · O(n)
Goal:Find the longest substring without repeating characters. The window expands when characters are unique, and contracts when a repeat is found.
a
0
b
1
c
2
a
3
b
4
c
5
b
6
b
7
▲
L,R
INPUT STRING (max 20)
READOUT
step0 / 15
window length1
longest so far1
actionexpand
statusIDLE