Longest Substring Without Repeating Characters
Given a string s, find the length of the longest substring without repeating characters.
Longest Substring Without Repeating Characters
Given a string s, find the length of the longest substring without repeating characters.
Example 1
Input: s = "abcabcbb" Output: 3
Example 2
Input: s = "bbbbb" Output: 1
Show hint
Use sliding window technique with a hash map to track character positions. Expand window and shrink when duplicate found.
Sign in to submit, save progress and mark problems as solved. You can still run your code.
Loading editor...
s =
"abcabcbb"
Expected
3