I am not able to understand why i am getting TLE in the given question.
According to me it will take O(T*log(n)) time which is under the limit.
also the matrix exponentiation function given in the question has been used correctly many times
Can anybody please help.
Consider the test input:
Thanks a lot.
good to see you back!!