Pregunta de entrevista de Morgan Stanley

Code, Probability, a tricky stats question