Bit Manipulation Problems
We may face many Interview Questions which can ask us to find the Sum of XOR of all pairs of the array OR Sum of XOR of all subsets Generally, the constraints for these questions are very high with the value of each array element to be as large as 10^18. So that is a catch to use Bit manipulation method to solve the questions. We will be discussing some of these questions in this post. Question 1: Sum of XOR of all possible subsets Given an array arr[] of size n, we need to find sum of all the values that comes from XORing all the elements of the subsets. Input Output 3 ...