← All problems

Longest Substring Without Repeating Characters

MediumSliding Window

Given a string, find the length of the longest substring without repeating characters.

Examples

Input: "abcabcbb"
Output: 3
Input: "bbbbb"
Output: 1
Input: "pwwkew"
Output: 3

Hints

Solution

Language:
Loading editor…
Output0 lines
Run your code to see output here.
Click Run all tests to check your solution against 6 test cases.