Longest Substring Without Repeating Characters
Return the length of the longest contiguous piece of s in which no character appears twice. An empty string gives 0.
Example 1
s "abcabcbb"
returns 3
The piece abc has length 3.
Example 2
s "bbbb"
returns 1
Only a single b fits.
Constraints
0 <= len(s) <= 100shas letters, digits and spaces
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.