You are viewing a single comment's thread. Return to all comments →
Solution in Python3:
def superDigit(n, k): n_str = str(n) if len(n_str) == 1: return int(n_str) suma = sum(int(i) for i in n_str) if k == 0: return superDigit(suma, 0) return superDigit(suma*k, 0)
Seems like cookies are disabled on this browser, please enable them to open this website
Recursive Digit Sum
You are viewing a single comment's thread. Return to all comments →
Solution in Python3: