#C13293. Longest Substring Without Repeating Characters

    ID: 42815 Type: Default 1000ms 256MiB

Longest Substring Without Repeating Characters

Longest Substring Without Repeating Characters

Given a string s, your task is to find the length of the longest substring without any repeating characters. In other words, you need to find the maximum number of consecutive characters in the string such that each character appears only once.

The solution should read the input string from stdin and output the result to stdout.

For example, if the input is "abcabcbb", the longest substring without repeating characters is "abc", whose length is 3.

Note: If the input string is empty, the output should be 0.

inputFormat

The input consists of a single line containing a string s. The string may include spaces and other visible characters. Read the input from stdin.

outputFormat

Output a single integer which is the length of the longest substring without repeating characters. The output should be written to stdout.

## sample
abcabcbb
3