69. Longest Substring Without Repeating Characters

Find the length of the longest substring without repeating characters.
Example 1
Input: s = "pwwkew"
Output: 3
Explanation: The maximum length is achieved on the substrings "wke" or "kew".
Example 2
Input: s = "abcabcbb"
Output: 3
Explanation: The longest substring without repeats is "abc".
Example 3
Input: s = "bbbbb"
Output: 1
Explanation: Any substring longer than 1 contains a repeated b.
hash tablemediumstrings
JavaScript
Loading...
Line 1, Char 1