You are viewing a single comment's thread. Return to all comments →
I solved it by building a lazy list of fib numbers.
You can solve it without memoization by starting from 0 carrying the last two fib numbers with you.
fibHelper currentIndex desiredIndex currentFib prevFib =
something like that
Seems like cookies are disabled on this browser, please enable them to open this website
Fibonacci
You are viewing a single comment's thread. Return to all comments →
I solved it by building a lazy list of fib numbers.
You can solve it without memoization by starting from 0 carrying the last two fib numbers with you.
fibHelper currentIndex desiredIndex currentFib prevFib =
something like that