Citadel Interview Question

Some dynamic programming question