#C13634. Longest Substring Without Repeating Characters

    ID: 43194 Type: Default 1000ms 256MiB

Longest Substring Without Repeating Characters

Longest Substring Without Repeating Characters

Given a string s, find the length of the longest substring that does not contain any repeating characters.

You are required to implement a solution that reads an input string from stdin and outputs the corresponding result to stdout. The problem can be formulated using the following definition:

Let \(f(s)\) be the length of the longest substring of s without any duplicate characters. For example, for the string "abcabcbb", \(f(s)=3\) because the substring "abc" is the longest substring without repeating characters. Note that the solution should consider different cases and spaces as valid characters.

Input Constraints: The input string can contain letters, digits, spaces and punctuation symbols. The length of the string is at most \(10^5\) characters.

inputFormat

The input consists of a single line containing the string s.

Input is provided via stdin.

outputFormat

Output a single integer representing the length of the longest substring of s that does not contain any repeating characters.

Output should be printed to stdout.

## sample
abcabcbb
3