We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
We're asked to solve this with recursion as a practice, but there's a faster way using the fact that powers of ten are all 1 modulo 9. One can also filter out all 0's and 9's from both numbers before multiplying the sum of their digits.
Super Digit
You are viewing a single comment's thread. Return to all comments →
We're asked to solve this with recursion as a practice, but there's a faster way using the fact that powers of ten are all
1
modulo9
. One can also filter out all0
's and9
's from both numbers before multiplying the sum of their digits.