We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
couple hints:
1. don't compute all fibonacci numbers, the even ones are sufficient
2. store a fine selection of even fibonacci numbers and their pre sums for later reference
3. you can even speed up the search for the matching even fibonacci number by using a matching exponential factor and some log functions
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #2: Even Fibonacci numbers
You are viewing a single comment's thread. Return to all comments →
couple hints: 1. don't compute all fibonacci numbers, the even ones are sufficient 2. store a fine selection of even fibonacci numbers and their pre sums for later reference 3. you can even speed up the search for the matching even fibonacci number by using a matching exponential factor and some log functions