pathetic code but 100% beats and understandable
helper function, sums the group
helper function convert does 1 roundCode
helper function, sums the group
helper function convert does 1 round
# Code
```cpp []
class Solution 
{
public:
    string sum(string st)
    {
        int s = 0;
        for(char c : st)
            s+= c-'0';
        return to_string(s);
    }
    string convert(string s, int k)
    {
        vector<string> groups;
        while(s.size()>=k)
        {
            groups.push_back(s.substr(0, k));
            s.erase(s.begin(),s.begin()+k);
        }
        if(s.size()>0)
            groups.push_back(s);
        string ans;
        for(string num : groups)
        {
            ans+=sum(num);
        }
        return ans;
    }
    string digitSum(string s, int k) 
    {
        while(s.size()>k)
            s = convert(s,k);
        return s;
    }
};
```
['C++']