Problem 3723 · Medium

Maximize Sum of Squares of Digits

Squares are largest when digits are pushed to the extremes, so fill with as many 9s as the sum allows, one leftover digit, then zeros.

Open the interactive visualisation