Longest Substring Without Repeat

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

Example:

The longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3.

For "bbbbb" the longest substring is "b", with the length of 1.

Interview Code Editor
Hints
  • Solution Approach
  • Complete Solution
3878 successful submissions.
Asked In:
  • Amazon
Click here to jump start your coding interview preparation