Domanda di colloquio di Duco

It was a 2-dimensional dynamic programming question.