[ JAVA ] --> 1ms Runtime easy and elegant Solution
\nint n=0,sum=0;\nStringBuilder ss=new StringBuilder(s);\nStringBuilder sk=new StringBuilder();\nwhile(ss.length()>k) {\n\tfor (int i = 0; i <= ss.length() - 1;
```\nint n=0,sum=0;\nStringBuilder ss=new StringBuilder(s);\nStringBuilder sk=new StringBuilder();\nwhile(ss.length()>k) {\n\tfor (int i = 0; i <= ss.length() - 1; i++) {\n\t\tsum += ss.charAt(i) - \'0\';\n\t\tn++;\n\t\tif (n == k || i == ss.length() - 1) {\n\t\t\tsk.append(sum);\n\t\t\tn = 0;\n\t\t\tsum=0;\n\t\t\tif (i == ss.length() - 1) {\n\t\t\t\tss = new StringBuilder(sk);\n\t\t\t\tsk = new StringBuilder();\n\t\t\t}\n\t\t}\n\t}\n}\nreturn String.valueOf(ss);\n\n```\n**If you have any question, feel free to ask. If you like the solution or the explanation, Please UPVOTE !**
['String', 'Java']