Positions of Large Groups
A group is a maximal run of the same character in s. A large group has 3 or more characters. Return a list of [start, end] index pairs (both inclusive) for every large group, in order from left to right. Return an empty list if there are none.
Example 1
s "abbxxxxzzy"
returns [[3,6]]
Only xxxx is large: [[3, 6]].
Example 2
s "abc"
returns []
No large groups.
Constraints
1 <= len(s) <= 100- Lowercase letters only
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.