SDE Path

Longest Substring Without Repeating Characters

Medium

Longest Substring Without Repeating Characters

Find the length of the longest substring of a string without repeating characters.

Input format

The first line contains a single string S (lowercase letters).

Output format

Print the length of the longest substring without repeating characters.

Constraints

  • Values fit in a 64-bit signed integer
  • Trailing whitespace and a trailing newline are ignored by the judge

Read from stdin, write to stdout. Sample cases below show the exact format.

Sample cases

Example 1
Input
abcabcbb
Expected output
3
Example 2
Input
bbbbb
Expected output
1