Answers to: Chef and An Ideal Problem Dec 2018 Editorial (Unofficial)https://discuss.codechef.com/questions/143947/chef-and-an-ideal-problem-dec-2018-editorial-unofficial<p>Monty Hall Problem suggests that when a person swaps the doors after knowing the location of goat in one of the two doors. The probability of getting a car in the swapped door is 66%, increased from the previous 33%.
Solution--- <br>
So, we can randomly choose the initial door and accordingly swap the doors. It's a very naive approach but works. <br>
<a href="https://www.codechef.com/viewsolution/21803991">My solution</a></p>enTue, 15 Jan 2019 16:58:29 +0530Answer by aryanc403https://discuss.codechef.com/questions/143947/chef-and-an-ideal-problem-dec-2018-editorial-unofficial/143948<p>Your soln is wrong.<br>
It has 50% probability of failing.<br>
If x=1 and y=2 or x=2 and y=1 you will get WA.
If x=3 and y=2 you code will not print z.</p>aryanc403Tue, 15 Jan 2019 16:58:29 +0530https://discuss.codechef.com/questions/143947/chef-and-an-ideal-problem-dec-2018-editorial-unofficial/143948