Conditional Probability Estimation from Categorical Observations - Coding problem | OneNoughtOne