Domanda di colloquio di Canva

Dynamic programming problem with optimization