You are viewing a single comment's thread. Return to all comments →
def superDigit(n, k): # Write your code here supdig = (sum(list(map(int,n))))%9 supdig = int(supdig*k)%9 if supdig ==0: supdig = 9 return int(supdig)
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 →
def superDigit(n, k): # Write your code here supdig = (sum(list(map(int,n))))%9
supdig = int(supdig*k)%9 if supdig ==0: supdig = 9
return int(supdig)