I tried a lot but the following statement is not going in my head please explain it :
The efficient solution lies in the binary representation of the number. We consider all 0’s in binary representation. For every 0 at the i-th position, we can have 2i numbers smaller than or equal to x with greater XOR.
question_link:https://www.geeksforgeeks.org/count-smaller-values-whose-xor-x-greater-x/
Please explain that statement