Longest Substring Without Repeating Characters
Medium
LC #3
stringhash mapvariable windowNot attempted yet
Given a string s, return the length of the longest
substring (a contiguous run of characters) in which
no character appears more than once.
Example 1
Input: s = "abcabcbb"
Output: 3
"abc" is the longest.
Example 2
Input: s = "bbbbb"
Output: 1
Example 3
Input: s = "pwwkew"
Output: 3
"wke". "pwke" is not contiguous.
Constraints
- 0 ≤ len(s) ≤ 5·10^4
smay contain any characters (letters, digits, symbols, spaces).