Question bank › Two Pointers
Dsa Two Pointers Medium

All Unique in Substring

You are given a string containing lowercase letters. Your task is to find the length of the longest substring where all characters are unique. A substring is defined as a contiguous sequence of characters within the string. If there is no substring with unique characters, return 0. Input format: - A single line containing the string S (1 ≤ |S| ≤ 100000). Output format: - A single integer representing the length of the longest substring with all unique characters. Example: Input: abcabcbb 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
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.