Java Easy Consise
\nclass Solution {\n    public String digitSum(String s, int k) {\n        while(s.length() > k) s = gen(s,k);\n        return s;\n    }\n    public String gen(
```\nclass Solution {\n    public String digitSum(String s, int k) {\n        while(s.length() > k) s = gen(s,k);\n        return s;\n    }\n    public String gen(String s,int k){\n        String res = "";\n        for(int i=0;i < s.length();){\n            int count = 0,num=0;\n            while(i < s.length() && count++ < k) num += Character.getNumericValue(s.charAt(i++));\n            res+=num;\n        }\n        return res;\n    }\n}\n```
['Java']