Easy C++ Solution
class Solution {\npublic:\n    string digitSum(string s, int k) {\n        \n        while(s.size()>k){\n            \n            int a=0,cnt=0;\n            s
class Solution {\npublic:\n    string digitSum(string s, int k) {\n        \n        while(s.size()>k){\n            \n            int a=0,cnt=0;\n            string t="";\n            \n            for(int i=0;i<s.size();i++){\n            \n                a+=(s[i]-\'0\');\n                cnt++;\n                if(cnt==k){\n                    t+=to_string(a);\n                    cnt=0;\n                    a=0;\n                }\n            }\n            if(cnt>0)\n               t+=to_string(a);\n            \n            s=t;\n        }\n        return s;\n    }\n};
['String', 'C']