Citadel Interview Question

Probability, A bit of coding