Solved sumOfDigits problem