Uber Interview Question

Haker Rank medium to difficult Dynamic Programming question.