here is my code,t=int(raw_input())for i in range(t): n1,n2=map(long,raw_input().split()) x=(n1**n2)%10 print (x)but it is giving TLE, someone tell me how to fix it ??
Please use code tags.
For this problem you can't use brute force to get AC, you need a better method.