Seven Bridges Interview Question

probability basics