Longest Substring Without Repeating Characters

Problem Find the length of the longest substring without repeating characters.

Input / Output

  • Input: string s. Output: length of the longest substring whose characters are all distinct.

Constraints

  • 0 ≤ |s| ≤ 5 × 10^4

Example

  • "abcabcbb" → 3 ("abc"); "bbbbb" → 1 ("b"); "pwwkew" → 3 ("wke").
added …
LeaderboardSalaryAccount