Longest Substring Without Repeats — Solution & Editorial
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|)
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|)