Medium · Strings

Longest substring with unique characters

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

Examples

Example 1

{
  "s": "abcabcbb"
}

Output: 3

Example 2

{
  "s": "pwwkew"
}

Output: 3

Rebuild it in the studio

Open every published interview problem, solution, scene, and memory room free, with no account.

More Strings problems