An instructor has given her student an assignment to calculate the sum of the digits of a positive integer using recursion.The student came up with the solution but the solution does not seem to be correct. Help her fix the error.
sumDigit(111) ➞ 3
// 1 + 1 + 1 = 3
sumDigit(222) ➞ 6
// 2 + 2 + 2 = 6
sumDigit(333) ➞ 9
// 3 + 3 + 3 = 9
Input is a positive integer.