Now divide elements in two sets by comparing rightmost set bit of xor with bit at same position in each element .
for ( i = 0 ; i < size ; i ++ ) { int a = arr [ i ] & set_bit_no ; if ( a != 0 ) x = x ^ arr [ i ] ;