complexityhashingstrings
Use last-seen positions for a no-repeat window
Anonymous
For the longest substring without repeated characters, store each character's last index. If a repeated character is still inside the current window, move the left edge just past its previous index; never move it backward. With expected O(1) hash-map operations, total time is O(n).
0