Medium · Arrays

Longest Substring Without Repeating Characters (Sliding window)

Given a string s, return the length of the longest substring of s (a contiguous run of characters) that contains no repeated character.

Examples

Example 1

{
  "s": "abcabcbb"
}

Output: len 3

Example 2

{
  "s": "pwwkew"
}

Output: len 3

Rebuild it in the studio

Core interview problems are free with a full runner and lessons; Pro opens the complete library.

More Arrays problems