Python 6line code || 98.60 %Beats || Simple Code
If you got help from this,... Plz Upvote .. it encourage me\n# Code\nShort Way:\n\nclass Solution:\n    def digitSum(self, s: str, k: int) -> str:\n        whil
**If you got help from this,... Plz Upvote .. it encourage me**\n# Code\nShort Way:\n```\nclass Solution:\n    def digitSum(self, s: str, k: int) -> str:\n        while len(s) > k:\n            new_s = \'\'\n            for i in range(0,len(s), k):\n                new_s += str(sum(int(d) for d in s[i:i+k]))\n            s = new_s \n        return s\n\n        \n```\n.\nSame Approach but long way to understand.\n```\nclass Solution:\n    def digitSum(self, s: str, k: int) -> str:\n        while len(s) > k:\n            new_s = \'\'\n            for i in range(0,len(s), k):\n                temp = 0\n                for d in s[i:i+k]:\n                    temp += int(d)\n \n                new_s += str(temp)\n\n            s = new_s\n        \n        return s\n```
['String', 'Python', 'Python3']