Pregunta de entrevista de Canva

Dynamic programming problem with optimization