Sliding Window
LC #3Medium
Longest Substring Without Repeating Characters
Sliding Window
AmazonGoogleMetaMicrosoftBloombergProblem
Find the length of the longest substring that contains no repeating characters.
stringsliding-windowhash-map
Constraints
- ›0 ≤ s.length ≤ 5 × 10⁴
- ›s consists of English letters, digits, symbols, and spaces
Example
Input
s = "abcabcbb"Output
3Why
"abc" is the longest substring without repeating characters