You are viewing a single comment's thread. Return to all comments →
With Derivation of Answer
def solve(a, n, m): digits = len(str(a)) divisor = 10**digits-1 m *= divisor return (a % m)*(pow(10, digits*n, m)-1) % m // divisor
Seems like cookies are disabled on this browser, please enable them to open this website
Eugene and Big Number
You are viewing a single comment's thread. Return to all comments →
My Python Loopless Solution
With Derivation of Answer
Explanation