#K92772. Longest Substring Without Repeating Characters

    ID: 38272 Type: Default 1000ms 256MiB

Longest Substring Without Repeating Characters

Longest Substring Without Repeating Characters

You are given a string s. Your task is to find the length of the longest substring without repeating characters.

In other words, if we denote the substring as s[i...j], you need to maximize its length under the condition that every character in s[i...j] is unique. Formally, if L(s) represents the length of the longest substring without repeating characters, then

\(L(s) = \max_{0 \le i \le j < n}\{j - i + 1 \;|\; \text{all characters in } s[i...j] \text{ are distinct}\}\)

This is a classic problem that tests your ability to utilize efficient algorithms (like the sliding window technique) to achieve optimal performance.

inputFormat

The input consists of a single line containing the string s. The string may include letters, digits, and other printable characters.

outputFormat

Output a single integer, representing the length of the longest substring of s that contains no repeated characters.

## sample
abcabcbb
3