#K78697. Longest Substring Without Repeating Characters

    ID: 35144 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 requires an efficient solution using a sliding window technique.

In other words, if (s) is your input string, you are to determine the maximum length (L) such that there exists a contiguous substring of s with length (L) where each character appears only once.

inputFormat

The input consists of a single line containing the string s. The string may include alphabets, digits, and special characters. Its length is in the range ([0, 10^5]).

outputFormat

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

abcabcbb
3