Uber Interview Question

Pretty simple dynamic programming question