[Solution] The Lost Array CodeChef Solution | CodeChef Problem Solution 2022
JJ had an array of length such that for all .
He listed down the XOR of all the subsequences of of size in some random order. Let's call the XOR of these subsequences as .
Unfortunately, he lost the initial array . Can you help him recover it?
If there are multiple arrays which satisfy the given conditions, print any. Also, it is guaranteed that corresponding to the given input, an answer always exists.
Input Format
- The first line will contain - the number of test cases. Then the test cases follow.
- The first line of each test case contains an integer - the size of the initial array .
- The second line of each test case contains integers - the XOR of all the
Solution Click Below:- CLICK HERE
- subsequences of of size in some random order.
Output Format
For each test case, output integers which satisfy the given conditions.
If multiple answers exist, print any.
Constraints
- Sum of over all test cases does not exceed
No comments:
Post a Comment