#K63497. Longest Substring Without Repeating Characters
Longest Substring Without Repeating Characters
Longest Substring Without Repeating Characters
Given a string s consisting of lowercase English letters, your task is to determine the length of the longest substring in which all characters are distinct.
For example, in the string abcabcbb
, the longest substring without repeating characters is abc
with a length of 3.
If the input string is empty, output should be 0. Note that a substring is a contiguous sequence of characters within the string.
inputFormat
The input consists of a single line containing a string s
made up of lowercase English letters. The string may be empty.
outputFormat
Output a single integer which is the length of the longest substring of s
that contains no repeated characters.
abcabcbb
3