• + 0 comments

    Python solution in one line of code:

    def flippingBits(n):
        return int(''.join('1' if bit == '0' else '0' for bit in format(n, "032b")), 2)