Pregunta de entrevista de Google

Coding challenge had a dynamic programming problem.