Guest User

Untitled

a guest
Jul 17th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. function fibonacci(n, memo = {0: 0, 1: 1}){
  2. if(memo[n] !== undefined) return memo[n];
  3.  
  4. memo[n] = fibonacci(n-1, memo) + fibonacci(n-2, memo);
  5.  
  6. return memo[n];
  7. }
Add Comment
Please, Sign In to add comment