3. Longest Substring Without Repeating Characters
Solutions
Sliding Window
- Keep pointer
start
andcurr
, a set ofoccurred
characters - If
s[curr]
has occurred, movestart
to next and updateoccurred
untils[curr]
is not insideoccurred
- Keep the largest
curr - start + 1
as the result