Domanda di colloquio di Cisco

There was a programming question which we have to solve using dynamic programming