Regarding Time Limit Exceeded

I have used fast Exponentiation method but still I am getting TLE, can anyone please tell me where I am going wrong?

Your code seems fine. Where did you get TLE ?

Hacker blocks or somewhere else ?

Test Case 1 and 2…

In this question only in test case 1 & 2 I am getting TLE…

Try the last method logn fibonacci in this without matrix one. https://www.geeksforgeeks.org/program-for-nth-fibonacci-number/. Save the intermediate results in an unrodered_map like dp

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.