• + 0 comments

    def theGreatXor(x): list_val_bin = list(bin(x)) y = (2**(len(list_val_bin)-2))-1 return int(bin(x ^ y), 2)