Problem
Given a string s, return the length of the longest substring that has no repeated characters. A substring is a contiguous run of characters, so "pwke" does not count for "pwwkew".
Example 1
- Input
- "abcabcbb"
- Output
- 3
- Why
- "abc"
Example 2
- Input
- "bbbbb"
- Output
- 1
- Why
- "b"
Example 3
- Input
- "pwwkew"
- Output
- 3
- Why
- "wke"
Constraints
0 <= s.length <= 5 * 10^4s consists of English letters, digits, symbols and spaces.