Pergunta de entrevista da empresa Citadel Securities

dynamic programming game, find the recursion.