Pergunta de entrevista da empresa Citadel

A question about dynamic programming.