Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
No recursion solution in Speedy category for Sum of Digits by Spiritusvini
def sum_digits(num: int) -> int:
str_num = list(map(int, list(str(num))))
sod = str_num.pop(0)
for n in str_num:
sod = (sod + n - 1)%9 + 1
return sod
Oct. 1, 2022
Comments: