Wrong Answer in nth-fibonacci

I need help with this question. I am getting all test cases as wrong answers.

Here is my implementation using Matrix Exponentiation. Please tell me where I am going wrong.
Thanks in advance.

Hey @sanjit_15 you have doubt in which problem? As you have tagged fast Fibonacci and code isn’t similar to that. So do mention the problem in a new doubt so that i can help you with the same.

I have tried to implement the solution on my own. I am getting correct answers for small values. But on submission I got Wrong Answer. So I am asking what is the problem in my code.
The Transformation Matrix I have used is
| 0 1 | | f(n-2) | = | f(n-1) |
| 1 1 | | f(n-1) | = | f(n) |
where f(n) = f(n-1) + f(n-2).

What’s the tag of the problem you are doing it for? I have to see the problem also. That’s why i have asked you the problem tag associated.

Problem name : FAST FIBONACCI
https://hack.codingblocks.com/app/practice/1/724/problem

Bro submit this , this will pass test cases. Just have updated your code nothing else. Also have mention the changes that will help in understanding it better

1 Like

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.