Pregunta de entrevista de Conviva

Whiteboard type algorithm dynamic programming question.