Fibonacci (Memoized)

Hard · javascript · javascript · dynamic-programming

Write solution(n) that returns the nth Fibonacci number (0-indexed: fib(0)=0, fib(1)=1) efficiently enough for n up to 40 within the time limit.

Sample tests

solution(10) // => 55

Submit

Leaderboard