3. Longest Substring Without Repeating Characters
Practice Longest Substring Without Repeating Characters for free on NudgeCode: Medium, Sliding Window pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.
Find the length of the longest contiguous piece of s in which no character appears twice.
Example
s = "abcabcbb" -> 3 ("abc")
s = "bbbbb" -> 1 ("b")
s = "pwwkew" -> 3 ("wke"; "pwke" is not contiguous)
Constraints
- 0 <= s.length <= 5 * 10^4
scontains English letters, digits, symbols and spaces