Positions of Large Groups Solutions in PythonNumber 830Difficulty EasyAcceptance 49.6%Link LeetCodeOther languages —SolutionsPython solution by haoel/leetcodedef largeGroupPositions(self, S): res = [] i = 0 while i < len(S) - 2: if S[i] == S[i + 1] and S[i] == S[i + 2]: val = S[i] index = i while i < len(S) and S[i] == val: i += 1 res.append([index, i - 1]) i -= 1 i += 1 return resdef largeGroupPositions(self, S): res = [] i = 0 while i < len(S) - 2: if S[i] == S[i + 1] and S[i] == S[i + 2]: val = S[i] index = i while i < len(S) and S[i] == val: i += 1 res.append([index, i - 1]) i -= 1 i += 1 return res