Problem · String
Longest Substring Without Repeating Characters
Learn this problemProblem statement
Return the length of the longest contiguous substring of s whose characters are all distinct.
Function
lengthOfLongestSubstring(s: String) → intExamples
Example 1
s = "abcabcbb"return = 3"abc" is a longest substring with no repeated character.
Constraints
0 <= s.length <= 200000scontains printable ASCII characters.