Solution
We solve the problem using the Pisano period approach as we did for the Last Digit of the Sum of Fibonacci Numbers Problem.
Code
Here is the complete implementation of the challenge. Click the “Run” button to see how it works.
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.