Available question text
Count the number of contiguous substrings where every distinct character appears exactly k times and every adjacent pair of characters differs by at most 2 positions in the alphabet. With word length up to 1e5, you must efficiently combine per-character frequency constraints with the local adjacency restriction to enumerate valid substrings.
Related questions
Continue with questions that share topics or the same question type.
- Count Beautiful Substrings I
Coding
- Count Beautiful Substrings II
Coding
- Count Binary Substrings
Coding · String · Two Pointers
- Count Cells in Overlapping Horizontal and Vertical 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 2953. Count Complete Substrings
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source