Dsa
Two Pointers
Easy
Longest Distinct Substring
You are given a string. Your task is to find the length of the longest substring that contains all distinct characters. Print the length of this substring.
Input Format:
- A single line containing the input string (1 <= len(string) <= 100).
Output Format:
- A single integer representing the length of the longest substring with all distinct characters.
Example:
Input:
abca
Output:
3
Key concepts
two_pointersstringssliding_window
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