$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · hard · #248

What goes in the blank?

def fib(n, memo={}):
    if n in ____:
        return memo[n]

Answer: memo (also accepted: memo)

Checking the cache first is what turns exponential recursion into linear.
Play Problem Solving ▸