Add solution and tests for sumOfDigits