Calculate the n-th Fibonacci number efficiently for very large values of n (e.g., n up to 10^9), returning the result modulo a given number if required, or using matrix exponentiation / fast doubling.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.