Dsa
Sliding Window
Easy
Longest Sequence of Distinct Characters
Given a string of characters, write a function to find the length of the longest substring that contains all distinct characters. The input is a single string, and the output should be an integer representing the length of the longest substring.
Example:
Input:
abcabcbb
Output:
3
Key concepts
sliding_windowstringset
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now