Pinterest Interview Question

A problem that combines binary search with dynamic programming.