#C11156. Longest Unique Substring

    ID: 40441 Type: Default 1000ms 256MiB

Longest Unique Substring

Longest Unique Substring

You are given a string s. Your task is to find the length of the longest substring of s that does not contain any repeating characters.

More formally, if we denote any substring of s by s[i...j], you are to compute:

$$\max_{0 \le i \le j < |s|} (j - i + 1)$$

such that every character in s[i...j] is unique.

For example, given s = "ABCABCBB", the answer is 3 because the longest substring without repeating characters is "ABC".

inputFormat

The input consists of a single line containing the string s. The string can include any characters.

outputFormat

Output a single integer which is the length of the longest substring of s without repeating characters.

## sample
ABCABCBB
3