Given an integer num, repeatedly add all its digits until the result has only one digit, and return it.
num
This process of summing digits repeatedly is known as finding the digital root of a number.
0 <= num <= 2^31 - 1
num = 38
2
num = 0
0