#C5279. Longest Substring Without Repeating Characters

    ID: 48910 Type: Default 1000ms 256MiB

Longest Substring Without Repeating Characters

Longest Substring Without Repeating Characters

Given a string \(T\) consisting of lowercase English letters, your task is to find the length of the longest substring without any repeating characters.

A substring is defined as a contiguous sequence of characters within the string. For example, if \(T = \texttt{abcabcbb}\), then the answer is 3 because the longest substring without repeating characters is "abc".

Note: \(T\) can be empty, in which case the answer is 0. Use an efficient algorithm with a linear traversal (i.e., the sliding window technique) to solve this problem.

inputFormat

The input is read from standard input. It consists of a single line containing the string \(T\). The string \(T\) may be empty and consists only of lowercase English letters.

outputFormat

Output a single integer that represents the length of the longest substring of \(T\) that does not contain any repeating characters. The output should be written to standard output.

## sample
abcabcbb
3