Longest Substring Without Repeating Characters
Return the maximum length of a contiguous substring containing no repeated character.
Example 1
s = "abba"2Explanation
ab and ba are valid length-two windows; every longer window repeats a letter.
Example 2
s = "pwwkew"3Explanation
wke has length three; a subsequence does not qualify as a contiguous substring.
Example 3
s = ""0Explanation
An empty string has maximum window length zero.
Constraints
- 0 <= len(s) <= 50000
- s contains ASCII characters
Function contract
lengthOfLongestSubstringArguments: jsonSolutionRuns on your device
Loading draft…
Run: 3 examples; Submit: 42 cases, on your device.
"abba"