#C4280. Longest Unique Character Substring

    ID: 47801 Type: Default 1000ms 256MiB

Longest Unique Character Substring

Longest Unique Character Substring

Given a string (S), find the length of the longest substring without repeating characters. In other words, determine the maximum length of a contiguous segment of (S) in which every character is unique.

For example, if (S = ) "abcabcbb", the longest substring without repeating characters is "abc", which has a length of (3).

inputFormat

The input is provided via standard input (stdin) as a single line containing the string (S). The string can consist of letters, digits, and symbols. An empty string is allowed.

outputFormat

Print the length of the longest substring in (S) that does not contain any repeating characters. The output should be sent to standard output (stdout).## sample

abcabcbb
3