Now divide elements in two sets by comparing rightmost set bit of xor with bit at same position in each element .
for i in range ( 0 , size ) : NEW_LINE INDENT if ( arr [ i ] & set_bit_no ) : NEW_LINE INDENT x = x ^ arr [ i ] NEW_LINE DEDENT DEDENT