Citadel interview question

Probability, A bit of coding