Domanda di colloquio di Google

Solve a coding problem with dynamic programming