LiteCode

Longest Substring Without Repeating Characters

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

Examples

Input: abcabcbb
Output: 3
Input: bbbbb
Output: 1

Constraints

  • 1 <= |s| <= 1e5
  • s consists of ASCII letters and digits only