Once upon a time, there was a hero and an old saint. And like in any story with a hero and an old saint, the old saint asked the hero — three questions! But here’s the twist: each question was a binary question, which means that the answer to each must be either a ‘Yes’ or a ‘No’, not none, not both. Our hero, who was not so wise in the ways of science, answered them arbitrarily and just hoped he is correct. The old saint, being so old, does not remember which answers were correct. The only thing that he remembers is – how many of them were ‘Yes’, and how many of them were ‘No’. Our hero will pass the test if the old saint cannot distinguish his responses from the set of correct answers i.e. if the number of ‘Yes’ and ‘No’ in the responses matches that in the correct answers, regardless of their order. The Old Saint And Three Questions solution codechef 100% correct solution

Once upon a time, there was a hero and an old saint. And like in any story with a hero and an old saint, the old saint asked the hero — three questions! But here’s the twist: each question was a binary question, which means that the answer to each must be either a ‘Yes’ or a … Read more