Longest Substring Without Repeating Characters
Mediumjavapythonccppjavascript
Given a string, find the length of the longest substring that contains no repeated character.
Input Format
A single line containing the string S with no spaces.
Output Format
Print the length of the longest substring with all distinct characters.
Example 1
Input
abcabcbb
Output
3
Explanation: abc is the longest substring with all unique characters.
- 1 <= length of S <= 100000
- S consists of lowercase English letters and digits.
Submit an attempt to unlock the solution. (Sign in first.)
Related Problems
- Reverse a StringEasy · java, python, c, cpp, javascriptSolve Problem
- Check PalindromeEasy · java, python, c, cpp, javascriptSolve Problem
- Count Vowels and ConsonantsEasy · java, python, c, cpp, javascriptSolve Problem