#K69452. Longest Substring Without Repeating Characters

    ID: 33089 Type: Default 1000ms 256MiB

Longest Substring Without Repeating Characters

Longest Substring Without Repeating Characters

In this problem, you are given a string ( s ). Your task is to determine the length of the longest substring that does not contain any repeating characters. A substring is defined as a contiguous sequence of characters within the string. For instance, given the string abcabcbb, the answer is 3 because the longest substring without repeating characters is abc.

The problem tests your ability to use the sliding window technique to keep track of characters and their indices in order to efficiently calculate the answer. Make sure your solution reads input from stdin and writes the result to stdout.

inputFormat

The input consists of a single line containing the string ( s ). The string may contain letters, digits, or other printable characters.

outputFormat

Output a single integer representing the length of the longest substring without repeating characters.## sample

abcabcbb
3