Dsa
Sliding Window
Medium
Longest Unique Substring
Find the length of the longest substring without repeating characters in a given string `s`.
Input:
- The first line contains a single integer n (1 ≤ n ≤ 10^5), the length of the string.
- The second line contains the string `s`, containing only lowercase alphabetical characters.
Output:
- An integer representing the length of the longest substring without repeating characters.
Example:
Input:
13
abcabcbb
Output:
3
Key concepts
sliding_windowstringshashmap
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