Iterate and Sum
\n# Code\n\npublic class Solution \n{\n    public string DigitSum(string s, int k)\n    {\n        while(s.Length>k)\n        {\n            var sb = new String
\n# Code\n```\npublic class Solution \n{\n    public string DigitSum(string s, int k)\n    {\n        while(s.Length>k)\n        {\n            var sb = new StringBuilder();\n            int j=k;\n            int ans=0;\n            for(var i=0;i<s.Length;i++)\n            {\n                ans+=Convert.ToInt32(s[i].ToString());\n                if(i==j-1)\n                {\n                    sb.Append(ans.ToString());\n                    ans=0;\n                    j+=k;\n                }\n            }\n            if(j>s.Length && s.Length%k!=0)\n            {\n                sb.Append(ans.ToString());\n                ans=0;\n                j+=k;\n            }\n            s=sb.ToString();\n        }\n        return s;\n    }\n}\n```
['C#']