• + 0 comments

    The problem says that we have a number n. The possible generated numbers from n are 0 to 2^N - 1. Lets say this value is x.

    power set of x will generate 2 ^ x sets.

    xor is a modulo 2 sum i.e. sum all the elements and take its xor. if the sum is even then it will generate 0 otherwise 1.

    from the 2^x sets, half will generate even sum and half will generate odd.