Pregunta de entrevista de Squarepoint Capital

Dynamic programming problem with space optimization