In Meta Messenger, you need to analyze a text string and find the length of the longest contiguous substring that contains no repeated characters.
Write a function that takes a string s and returns an integer: the maximum length of any substring of s in which every character appears at most once.
sExample 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". Note that "pwke" is not contiguous, so it does not count.0 <= len(s) <= 5 * 10^4s consists of English letters, digits, symbols, and spaces