In Providence messaging and note-entry surfaces, repeated characters can appear in free-text input. Write a function that returns the length of the longest substring in a string s that contains no repeated characters.
ss with all unique charactersA substring must be contiguous. The function should run efficiently for large inputs.
Example 1
s = "abcabcbb"3"abc", which has length 3.Example 2
s = "bbbbb"1"b", so the best answer is 1.Example 3
s = "pwwkew"3"wke" is a valid longest substring. "pwke" is not valid because it is not contiguous.0 <= len(s) <= 10^5s may contain letters, digits, symbols, and spaces