Question
[LeetCode 258] Given a non-negative integer num
, repeatedly add all its digits until the result has only one digit.
Submission
Find the digital root of any positive number. The solution appear periodically from 1 to 9.
1 | public class Solution { |
Reference
- Digital root https://en.wikipedia.org/wiki/Digital_root