[Solved] Python Recursion Puzzle: Buying n McNuggets at McDonalds (using 6, 9 and 20 packs) [closed]


Recursion works by breaking down each problem to a “smaller” version of the same problem. In this case, you can insert this code:

elif n < 0:
    return False

elif is_buyable(n - 20) or is_buyable(n - 9) or is_buyable(n - 6):
    return True

4

solved Python Recursion Puzzle: Buying n McNuggets at McDonalds (using 6, 9 and 20 packs) [closed]