96. Conditional Probability From Sets

Easy

Conditioning on BB makes BB the new sample space. For equally likely outcomes:

P(A∣B)=∣A∩B∣∣B∣P(A \mid B) = \frac{|A \cap B|}{|B|}

Return P(A∣B)P(A \mid B) as a float. Assume b is non-empty.

Input

a = {2, 4, 6}
b = {4, 5, 6}

Output

0.6666666666666666
Implement solve(...)