#K77452. Longest Substring Without Repeating Characters

    ID: 34867 Type: Default 1000ms 256MiB

Longest Substring Without Repeating Characters

Longest Substring Without Repeating Characters

Given a string \( S \), determine the length of the longest substring without repeating characters.

A substring is a contiguous sequence of characters. In this problem, you need to find the maximum length of a substring of \( S \) where all characters are unique.

You may use a sliding window technique to achieve an efficient solution. For example, given the input 'abcabcbb', the longest substring without repeating characters is 'abc' which has a length of 3.

inputFormat

The input consists of a single line containing the string \( S \), which may include spaces, letters, digits, and special characters. The input is read from standard input (stdin).

outputFormat

Output an integer representing the length of the longest substring of \( S \) that does not contain any repeating characters. The output should be written to standard output (stdout).

## sample
abcabcbb
3