Likha tha logic still kuch bugs the wo fix krne mein help lagi will try tm again :D
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    string digitSum(string s, int k) {\n        \n        string temp=s;\n       \n        int num=0;\n        string calc="";\n        int c=0;\n\n        while(temp.size()>k)\n        {\n            calc="";\n            num=0;\n            c=0;\n            for(int i=0;i<temp.size();i++)\n            {\n\n                num+=temp[i]-\'0\';\n                c++;\n\n                if(c==k||i==temp.size()-1)\n                {\n                   calc+=to_string(num);\n                   num=0;\n                   c=0;\n                }\n                \n                   \n                \n\n                \n            }\n\n            \n\n            temp=calc;\n\n        }\n        return temp;\n    }\n};\n```
['C++']