Pregunta de entrevista de Two Sigma

Online coding test. Probability questions.