Longest Substring Without Repeating Characters

Medium
Strings Sliding Window Hash Set
Given a string `s`, find the length of the longest substring without repeating characters.

Constraints

0 <= s.length <= 50000 s consists of English letters, digits, symbols and spaces.

Examples

Example 1:
Input: abcabcbb
Output:
Explanation: abc is the longest
Example 2:
Input: bbbbb
Output:

Hints

Use a sliding window approach.
Keep track of characters in the current window.
▲ Console

Install Talent Arabia

Get instant access to jobs and career tools on your device.