What goes in the blank?
def fib(n, memo={}):
if n in ____:
return memo[n]
Answer: memo
Checking the cache first is what turns exponential recursion into linear.
Play Problem Solving ▸
def fib(n, memo={}):
if n in ____:
return memo[n]
Answer: memo