3. Longest Substring Without Repeating Characters
3. Longest Substring Without Repeating Characters
Description
Difficulty: Medium
Related Topics: Hash Table, String, Sliding Window
Given a string s
, find the length of the longest substring without repeating characters.
Example 1:
1 | Input: s = "abcabcbb" |
Example 2:
1 | Input: s = "bbbbb" |
Example 3:
1 | Input: s = "pwwkew" |
Constraints:
- 0 <= s.length <= 5 * 104
s
consists of English letters, digits, symbols and spaces.
Hints/Notes
- Sliding window
Solution
Language: C++
1 | class Solution { |