Sum of Digits Divisibility

Back to General discussions forum

jquaranta89     2025-02-24 16:44:45

I am having a difficult time solving this problem. I can easily solve for the sum of digits of a number and solve the smaller test examples. However, when I get to the larger data set I can only get through the first few (3-4) before the program grinds to a halt. Is there some property of the sum of digits that I am forgetting? It seems that this problem is classified as simple but it proving to be far from simple for me.

zelevin     2025-02-24 17:01:11

I don't know how your solution works (and I'm trying not to spoil this problem for others), but, as a hint, I would like to point out that an efficient solution does not require N operations to find Nth number with the requested property, let alone 10N operations.

jquaranta89     2025-02-25 04:02:23

Thanks that got me through it!

Please login and solve 5 problems to be able to post at forum