PIXELBANKv8.2.1
Menu

Longest Substring Without Repeating Characters

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

Example:

Input:
abcabcbb
Output:
3
Reasoning:
  • We start by examining the input string abcabcbb and looking for substrings without repeating characters
  • The longest such substrings are abc, bcb, and cab, each having a length of 33 characters
  • We can see that there are no longer substrings without repeating characters, as any additional character would result in a repeated character
  • The final output is therefore 33, which is the length of the longest substring without repeating characters

Constraints:

  • 0 <= len(s) <= 5 * 10^4
  • s consists of English letters, digits, symbols and spaces
Editor

Test Results

0/0
Run code to see test results.