Pregunta de entrevista de Jane Street

Involved card deck shuffled problem