Simple Java Solution with comments for understanding
\nclass Solution {\n    public String digitSum(String s, int k) {\n        while(s.length()>k){\n            String ns=""; // replace the old string with update
```\nclass Solution {\n    public String digitSum(String s, int k) {\n        while(s.length()>k){\n            String ns=""; // replace the old string with updated one\n            for(int i=0;i<s.length();i+=k){\n                String t=s.substring(i,Math.min(i+k,s.length())); // form the string of k size\n                int sum=0;\n                for(int l=0;l<t.length();l++){ // to find the character sum of string t\n                    sum+=t.charAt(l)-\'0\';\n                }\n                ns+="" + sum;    //update the string with sum of k size string character                 \n            }\n            s=ns; //update the old string with updated one\n        }\n        return s;\n    }\n}\n```\nUpvote if it\'s helpful
['Array', 'String', 'Java']