#C7664. Longest Substring Without Repeating Characters

    ID: 51560 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 that does not contain any repeating characters.

This problem can be formulated mathematically as follows: Given a string \( s \) of length \( n \), find the maximum \( L \) such that there exists indices \( i \) and \( j \) with \( 0 \leq i \leq j < n \) where the substring \( s[i..j] \) contains all unique characters and \( L = j - i + 1 \).

Your task is to implement a program that reads the string from stdin and outputs the length of the longest substring without repeated characters to stdout.

inputFormat

The input consists of a single line that contains a string s. The string may include letters, digits, and symbols.

Input format: A single line from standard input.

outputFormat

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

Output format: A single integer printed to standard output.

## sample
abcabcbb
3