1# Runtime: 81 ms (Top 17.97%) | Memory: 13.9 MB (Top 73.17%)2class Solution:3def largeGroupPositions(self, s: str) -> List[List[int]]:45i = 06c = 17prev = ""8l = len(s)9ans = []10while i < l:11if s[i] == prev:12c += 113if (i == l - 1) & (c >= 3):14ans.append([i + 1 - c, i])15else:16if c >= 3:17ans.append([i - c, i - 1])18c = 119prev = s[i]20i += 121return ans