You are viewing a single comment's thread. Return to all comments →
def superDigit(N, K): # Write your code here return int(N) if K== 1 and len(N) == 1 else superDigit(str(K * sum([int(n) for n in N])), 1)
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Recursive Digit Sum
You are viewing a single comment's thread. Return to all comments →