Skip to content

sumsquareddigits

bradendubois edited this page Jun 9, 2021 · 4 revisions

Sum Squared Digits Function

ID: sumsquareddigits

Difficulty: 1.5

CPU Time: 1 second

Memory: 1024 MB

Solution

For this, one can take the given n, and until n == 0, add (n % b)^2 to a running total, and divide n by b.

Clone this wiki locally