Pregunta de entrevista de Showatech

They asked to solve the problem in dynamic programming