Given a non-negative integer `num`, repeatedly add all its digits until the result has only one digit, and return that digit.
**Follow up:** Can you do it without any loop or recursion, in O(1) time?
Example 1
Input:num = 38
Output:2
Explanation:38 -> 3 + 8 = 11 -> 1 + 1 = 2. Since 2 has only one digit, return it.