Pergunta de entrevista da empresa Grid Dynamics

Some kind of a probability problem