In Meta Messenger, you are given a message string s. Return the length of the longest contiguous substring that contains no repeated characters.
This is a standard string and sliding-window problem: scan the string once and maintain the largest valid window with all unique characters.
ss with all distinct charactersExample 1
s = "abcabcbb"3"abc", which has length 3.Example 2
s = "bbbbb"11 repeats the character "b".Example 3
s = "pwwkew"3"wke". "pwke" is not valid because a substring must be contiguous.0 <= len(s) <= 5 * 10^4s contains English letters, digits, symbols, and spaces