Search⌘ K
AI Features

Solution: Count Substrings with Only One Distinct Letter

Solution: Count Substrings with Only One Distinct Letter asks you to examine a string and return how many of its substrings consist of repetitions of a single letter.

Statement

Given a string s, return the total number of substrings that contain only one distinct letter.

Constraints:

  • 1≤ ...