class Solution {
public:
vector<vector<int>> largeGroupPositions(string S) {
int l = S.length();
vector<vector<int>> t;
int i=0;
while(i<l)
{
int start=i,end=i;
char tmp=S[i];
i++;
while(i<l&&S[i]==tmp)
{
i++;
}
end = i-1;
if(end-start>=2)
{
vector<int> c;
c.push_back(start);
c.push_back(end);
t.push_back(c);
}
}
return t;
}
};