Simple Recursive Java Solution with comments
\nclass Solution {\n    public String digitSum(String s, int k) {\n        if (s.length() <= k) return s;\n        \n        StringBuilder sb = new StringBuilde
```\nclass Solution {\n    public String digitSum(String s, int k) {\n        if (s.length() <= k) return s;\n        \n        StringBuilder sb = new StringBuilder();\n        for (int i=0; i < s.length(); i += k) {\n            int start = i;\n            int end = Math.min(i + k, s.length()); // To avoid indexOutOfBoundsException\n            int sum = findDigitSum(s.substring(start, end));\n            sb.append(sum);\n        }\n        \n        return digitSum(sb.toString(), k);\n    }\n               \n    \n    // Method to calculate the sum of digits of the string\n    private int findDigitSum(String s) {\n        int sum = 0;\n        int i = 0;\n        while (i < s.length()) {\n            sum += (s.charAt(i) - \'0\');\n            i++;\n        }\n        \n        return sum;\n    }\n}\n```
['Recursion', 'Java']