Given a set, find XOR of the XOR's of all subsets. - GeeksforGeeks
Given a set, find XOR of the XOR's of all subsets.
The question is to find XOR of the XOR's of all subsets. i.e if the set is {1,2,3}. All subsets are : [{1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}]. Find the XOR of each of the subset and then find the XOR of every subset result.
We strongly recommend you to minimize your browser and try this yourself first.
This is a very simple question to solve if we get the first step (and only step) right. The solution is XOR is always 0 when n > 1 and Set[0] when n is 1.
Read full article from Given a set, find XOR of the XOR's of all subsets. - GeeksforGeeks
No comments:
Post a Comment