double-mod-deficit-formula

Status: IN

The expression `(k - n % k) % k` is the standard formula for "units to add to make n a multiple of k" — the outer mod collapses the already-aligned case from k to 0.

Source: entries/2026/06/06/divide-a-string-into-groups-of-size-k-solution.md

JSON