You are viewing a single comment's thread. Return to all 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)
Seems like cookies are disabled on this browser, please enable them to open this website
Flipping bits
You are viewing a single comment's thread. Return to all comments →
Python solution in one line of code: