digit-sum-terminates

Status: IN

Each iteration of the `while len(s) > k` loop produces a strictly shorter string (summing `d` digits yields at most `ceil(log10(9d+1))` characters, which is less than `d` for `d >= 2`), guaranteeing termination for valid inputs.

Source: entries/2026/06/06/calculate-digit-sum-of-a-string-solution.md

JSON