Spotify tracks user activity strings where each character represents an event type. Given a string s, return the length of the longest substring without repeating characters.
A substring is a contiguous sequence of characters within the string. You must design an algorithm better than checking all possible substrings.
ss that contains no duplicate charactersExample 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". "pwke" is not valid because it is not contiguous.0 <= len(s) <= 5 * 10^4s consists of English letters, digits, symbols, and spaces