Solution: Huge Fibonacci Number

Solution for the Huge Fibonacci Number Problem.

We'll cover the following

Solution

In this problem, nn might be so huge that an algorithm looping for nn iterations will be too slow. Therefore, we need to avoid such a loop. To get an idea of how to solve this problem without going through all Fibonacci numbers FiF_i for ii from 00 to nn, take a look at the table below:

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.