Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1180. Count Substrings with Only One Distinct Letter
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.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.