Java Easy Understanding - 8ms Using Recursive
\n//This Solution Can Be Improved By Memoization Technique\nclass Solution {\n    public String digitSum(String s, int k) {\n        int sum = 0;\n        Strin
```\n//This Solution Can Be Improved By Memoization Technique\nclass Solution {\n    public String digitSum(String s, int k) {\n        int sum = 0;\n        String str = "";\n        //Check If The Summed Up String\'s Length Is Less Than K \n        while(s.length()>k){\n            //Recursive Function To Find The Summed Up String\n            s = calculateRecurse(s, k);\n        }\n        return s;\n    }\n        \n    public String calculateRecurse(String str, int k){\n        int sum = 0;\n        //Check If The String\'s Length Is Less/Equal To K\n        //Stopping Condition For A Recursive Function\n        if(str.length() <= k){\n            for(int i=0; i<str.length(); i++){\n                //Easiest Way To Convert A Char Value To Integer\n                sum += str.charAt(i) - 48;\n            }\n            //Easiest Way To Convert A Integer To Char\n            return sum + "";\n        }\n        //Recursive Flow Condition\n        String s = str.substring(0,k);\n        for(int i=0; i<k; i++){\n            sum += str.charAt(i) - 48;\n        }\n        return (sum + "") + calculateRecurse(str.substring(k,str.length()), k);\n    }\n}\n```
['Java']