#C5521. Longest Substring Without Repeating Characters

    ID: 49180 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 without repeating characters. In other words, you need to determine the maximum length of a contiguous substring in which each character appears only once. This problem can be solved efficiently by using a sliding window technique.

For example, given the input string "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 ). The string may contain letters, digits, or symbols.

outputFormat

Print an integer representing the length of the longest substring of ( s ) that contains no repeated characters.## sample

abcabcbb
3