Available question text
Count the number of substrings in a string that consist of a single repeated character (i.e., contain only one distinct letter). This is typically solved by scanning for consecutive runs of the same character and summing the number of substrings each run contributes (k*(k+1)/2) in O(n) time.
Related questions
Continue with questions that share topics or the same question type.
- Count Substrings That Differ by One Character
Coding
- Count Beautiful Substrings I
Coding
- Count Beautiful Substrings II
Coding
- Count Binary Substrings
Coding · String · Two Pointers
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 1180. Count Substrings with Only One Distinct Letter
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source