• + 0 comments
    def theGreatXor(x):
        return sum([1 << i if b == '0' else 0 for i, b in enumerate(bin(x)[:1:-1])])