

Given a string s, return the length of the longest substring that contains no repeated characters. A substring is a contiguous sequence of characters, and the function should return an integer.
Example 1:
Input: s = "abcabcbb"
Output: 3
Explanation: The longest substring without repeating characters is "abc".
Example 2:
Input: s = "bbbbb"
Output: 1
Explanation: The longest substring without repeating characters is "b".
Example 3:
Input: s = "pwwkew"
Output: 3
Explanation: The longest substring without repeating characters is "wke".
0 <= len(s) <= 5 * 10^4s consists of English letters, digits, symbols, and spacess = "abcabcbb"Output3WhyThe longest substring without repeated characters is "abc", which has length 3.s = "bbbbb"Output1WhyEvery substring longer than one character repeats `b`, so the answer is 1.s = "pwwkew"Output3Why"wke" is a longest valid substring, so the maximum length is 3.0 <= len(s) <= 5 * 10^4s consists of English letters, digits, symbols, and spacesA substring must be contiguousdef length_of_longest_substring(s):