LogiQuest

102. Longest Substring Without Repeats

MediumSliding Window

Print the length of the longest substring with all distinct characters.

Input format

A single line s (it may contain any printable characters).

Output format

The length.

Example 1

Input

abcabcbb

Output

3

Example 2

Input

bbbbb

Output

1

Constraints

1 ≤ |s| ≤ 10⁵

Read input from standard input and print the answer to standard output. Your code is judged against 6 test cases, most of them hidden.

Loading the MyLoginn IDE…