Practice Positions of Large Groups
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
In a string s of lowercase letters, these letters form consecutive groups of the same character. For example, a string like s = "abbxxxxzyy" has the groups "a", "bb", "xxxx", "z", and "yy". A group is identified by an interval [start, end], where start and end denote the start and end indices (inclusive) of the group. In the above example, "xxxx" has the interval [3,6]. A group is considered large if it has 3 or more characters. Return the intervals of every large group sorted in increasing order by start index.
Source: Positions of Large Groups on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
s = "abbxxxxzzy"
[[3,6]]
# Example 2
s = "abc"
[]
# Example 3
s = "abcdddeeeeaabbbcd"
[[3,5],[6,9],[12,14]]
Constraints
Related LeetCode Problems
Practice more problems similar to Positions of Large Groups.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.