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.
- Recursive Digit Sum
- Discussions
Recursive Digit Sum
Recursive Digit Sum
Sort by
recency
|
183 Discussions
|
Please Login in order to post a comment
My C solution : ( the long long to array part was not my part )
My C# solution:
The sum of the digits is the same as the value of the number reduced mod 9. This is because 10 = 1 mod 9. We can then just reduce mod 9 as we go. If the final result is 0, the super digit is 9.
Java solution: