Last digit of a large number Time : O(log(n2)) Space : O(1) python12def last_digit(n1, n2): return pow(n1,n2,10) % 10