Pregunta de entrevista de Compass

Dynamic programming algorithm problem