Problems > Longest Substring Without Repeats > Editorial

Longest Substring Without Repeats — Solution & Editorial

Back to the Problem

Sliding window: extend the right end; when a repeat enters, jump the left end past the previous occurrence. Track the best window length.

Complexity: O(|S|)