LeetCode 830. Positions of Large Group
Created at 2018-07-10 Updated at 2018-07-10 Category LeetCode
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
Call a group large if it has 3 or more characters. We would like the starting and ending positions of every large group.
The final answer should be in lexicographic order.
1 <= S.length <= 1000
Using two pointers,
r, if current
r and check if
r reach the end.