Problems

21. Longest Substring Without Repeating Characters

MediumStringAmazonGoogleMicrosoft

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

Example 1:

Input: s = "abcabcbb"
Output: 3

Example 2:

Input: s = "bbbbb"
Output: 1

Constraints:

  • 0 <= s.length <= 5 * 10^4
Core code mode
● Auto-savedLine 1, column 1