HCLTech Interview Question

Logic for probabilities