Objective
With a variable-size window you extend it on the right and shrink it on the left when a repeated character appears. A dictionary with the last position of each character avoids going back.
Instructions
- Read a line of text (no spaces, not empty).
- Show
Length: nwith the length of the longest contiguous substring that has no repeated characters.
abcabcbb
Length: 3
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise