[Solution] Equal by XORing CodeChef Solution | CodeChef Problem Solution 2022
JJ has three integers , , and . He can apply the following operation on :
- Select an integer such that and set . (Here, denotes the bitwise XOR operation.)
JJ wants to make equal to .
Determine the minimum number of operations required to do so. Print if it is not possible.
Input Format
- The first line contains a single integer — the number of test cases. Then the test cases follow.
Solution Click Below:- CLICK HERE
- The first and only line of each test case contains three integers , , and — the parameters mentioned in the statement.
Output Format
For each test case, output the minimum number of operations required to make equal to .
Output if it is not possible to do so.
No comments:
Post a Comment