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