Easy Understandable Soln | JAVA🔥
\n\n# Code\n\nclass Solution {\n    public String digitSum(String s, int k) {\n        int i=0;\n        while(s.length()>k){\n            i=0;\n            Str
\n\n# Code\n```\nclass Solution {\n    public String digitSum(String s, int k) {\n        int i=0;\n        while(s.length()>k){\n            i=0;\n            String ans="";\n            while(i<s.length()){\n                if(i+k>s.length()){\n                    ans+=find(s.substring(i,s.length()));\n                }\n                else{\n                    ans+=find(s.substring(i,i+k));\n                }  \n                i+=k;\n            }\n            s=ans;\n        }\n        return s;\n    }\n    public String find(String s){\n        int i=0;\n        int sum=0;\n        while(i<s.length()){\n            sum+=s.charAt(i)-\'0\';\n            i++;\n        }\n        return String.valueOf(sum);\n    }\n}\n```
['Java']