simple recursion
\nclass Solution:\n    def digitSum(self, s: str, k: int) -> str:\n        self.res=""\n        def recur(string):\n            if len(string)<=k:\n            
```\nclass Solution:\n    def digitSum(self, s: str, k: int) -> str:\n        self.res=""\n        def recur(string):\n            if len(string)<=k:\n                self.res=string\n                return string\n            i=0\n            newString=""\n            while i<len(string):\n                a=string[i:i+k]\n                sumn=None\n                for j in a:\n                    if not sumn:\n                        sumn=int(j)\n                        continue\n                    sumn+=int(j)\n                newString+=str(sumn)\n                i+=k\n            recur(newString)\n        recur(s)\n        return self.res\n```
['Python']