Available question text
Find the length of the longest substring in which every character appears at most twice. This is a sliding-window/counting problem over a small lowercase alphabet (2 <= |s| <= 100).
Related questions
Continue with questions that share topics or the same question type.
- Maximum Number of Occurrences of a Substring
Coding · Hash Table · Sliding Window · String
- Maximum Number of Vowels in a Substring of Given Length
Coding
- Maximum Product of the Length of Two Palindromic Subsequences
Coding
- Maximum Product of the Length of Two Palindromic Substrings
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 3090. Maximum Length Substring With Two Occurrences
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source