bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
EasyMath & GeometryLC 1180

Count Substrings with Only One Distinct Letter

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

Asked at 1 company
Virtu
Hints
  • 1.Think about which data structure fits best
  • 2.Consider the time complexity of your approach
  • 3.Look for patterns in the constraints
LeetCode