Pergunta de entrevista da empresa Jane Street

Involved card deck shuffled problem