Skip to content

Commit 0c5a8ea

Browse files
refactor 1180
1 parent 243c381 commit 0c5a8ea

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

src/main/java/com/fishercoder/solutions/_1180.java

-23
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,5 @@
11
package com.fishercoder.solutions;
22

3-
/**
4-
* 1180. Count Substrings with Only One Distinct Letter
5-
*
6-
* Given a string S, return the number of substrings that have only one distinct letter.
7-
*
8-
* Example 1:
9-
* Input: S = "aaaba"
10-
* Output: 8
11-
* Explanation: The substrings with one distinct letter are "aaa", "aa", "a", "b".
12-
* "aaa" occurs 1 time.
13-
* "aa" occurs 2 times.
14-
* "a" occurs 4 times.
15-
* "b" occurs 1 time.
16-
* So the answer is 1 + 2 + 4 + 1 = 8.
17-
*
18-
* Example 2:
19-
* Input: S = "aaaaaaaaaa"
20-
* Output: 55
21-
*
22-
* Constraints:
23-
* 1 <= S.length <= 1000
24-
* S[i] consists of only lowercase English letters.
25-
* */
263
public class _1180 {
274
public static class Solution1 {
285
public int countLetters(String S) {

0 commit comments

Comments
 (0)