Pregunta de entrevista de Hudson River Trading

One DFS problem too, was asked