Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. Implement this using recursion.
- A non-negative integer
num.
Input: num = 38
Output: 2
Explanation: 3 + 8 = 11, 1 + 1 = 2. Since 2 has only one digit, return it.