Back to problems

Iterative Digit String Group Summation

Algorithm · ByteDance · Medium

Repeated Digit-Sum Reduction Easy · Topics · Company Tags · Hints You are given a string number that contains only decimal digits, and a positive integer k. While number has more than k characters, apply the following transformation: Split number into consecutive groups of exactly k characters from left to right; the final group may be shorter. For each group, sum the digit values of all characters in that group. Convert each sum back into a decimal string and join them,…

Checking your access…