Google interview question

Solve a coding problem with dynamic programming