Leetcode - Add Digits (Python)

preview_player
Показать описание
July 2020 Leetcode Challenge
Leetcode - Add Digits

Very tricky problem, here's my video explaining the math

Рекомендации по теме
Комментарии
Автор

i had a weird way for doing the naive approach:

while(len(str(num)) > 1):
num = sum([int(a) for a in list(str(num))])
return num

i feel like this might be a fair game problem on an interview, if you started playing with the sequence to find the pattern

janmichaelaustria
join shbcf.ru