Pregunta de entrevista de Citadel

A question about dynamic programming.