Google Interview Question

Solve a coding problem with dynamic programming