NumPy allowed · plain Python earns 10 bonus points
Master the dynamic sliding window pattern: expand the right boundary and jump the left boundary using a character-to-last-seen-index hash map.
Implement length_of_longest_substring(s): return the length of the longest substring of s that contains no duplicate characters.
length_of_longest_substring(s: str) -> int