Given a string s, find the length of the longest substring without any repeating characters. A substring is a contiguous non-empty sequence of characters within the string. For example, in the string "abcabcbb", the longest substring without repeating characters is "abc" with length 3.
Example 1
Input: s = abcabcbb
Output: 3
Explanation: "abc" has no repeated letters and length 3. Every longer window repeats a letter (for example "abca" repeats 'a').
Example 2
Input: s = bbbbb
Output: 1
Explanation: Every character is 'b', so any substring longer than 1 repeats, and the answer is 1.
Example 3
Input: s = pwwkew
Output: 3
Explanation: "wke" has length 3 with no repeats. "pwke" is a subsequence, not a contiguous substring, so it does not count.
Keep a window `[l, r]` over the string such that it never contains a duplicate. When you find `s[r]` was seen *inside* the current window, jump `l` just past the previous occurrence — that's the smallest move that restores the invariant.
Run checks all cases above. Submit evaluates all test cases.