Back to exercises

Longest Substring Without Repeating Characters

Expand the right edge one character at a time and move the left edge forward whenever a duplicate falls inside the current window. Track the maximum window length as you go.

Coding Exercises Medium O(n)

Longest Substring Without Repeating Characters

Expand the right edge one character at a time and move the left edge forward whenever a duplicate falls inside the current window. Track the maximum window length as you go.

Find the length of the longest substring that contains no repeated characters.