Airbnb interview question

Dynamic programming, recursion, etc.