Dashboard
LC #3

Longest Substring Without Repeating Characters

Pattern · ?AmazonGoogleMetaMicrosoftBloomberg

Problem

Find the length of the longest substring that contains no repeating characters.

Constraints

  • 0 ≤ s.length ≤ 5 × 10⁴
  • s consists of English letters, digits, symbols, and spaces

Example

Input
s = "abcabcbb"
Output
3
Why
"abc" is the longest substring without repeating characters

Spot the pattern

Which pattern cracks it?

Hints

One at a time
Solve on LeetCode ↗