• + 0 comments

    Python3 one line solution:

    def solve(a, n, m):
        return(((((pow(10,n*(len(str(a))),(10**(len(str(a))) - 1)*m)-1)//(10**(len(str(a))) - 1))%m)*(a%m)%m))