Airbnb Interview Question

Array manipulation, dynamic programming, and reduce time complexity