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.
Although simple enough, I think it still uses the thoguht of DP - it keeps recording the two former numbers and build the solution from bottom to top, instead of recurring from top to bottom, which would lead to a huge number of unnecessary function calls.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Fibonacci Modified
You are viewing a single comment's thread. Return to all comments →
Although simple enough, I think it still uses the thoguht of DP - it keeps recording the two former numbers and build the solution from bottom to top, instead of recurring from top to bottom, which would lead to a huge number of unnecessary function calls.