#C4007. Longest Substring Without Repeating Characters

    ID: 47498 Type: Default 1000ms 256MiB

Longest Substring Without Repeating Characters

Longest Substring Without Repeating Characters

Given a string s, your task is to determine the length of the longest substring without any repeating characters. The substring is a contiguous sequence of characters within the input string.

For example, if s = "abcabcbb", the answer is 3 corresponding to the substring "abc". Similarly, for s = "pwwkew", the longest substring without repeating characters is "wke", so the output is 3.

Note: The input string can contain letters, digits, symbols, and spaces. An empty string should return 0.

inputFormat

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

outputFormat

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

abcabcbb
3