Old Mission interview question

Probability questions and leetcode medium