You are viewing a single comment's thread. Return to all comments →
Python:
def flippingBits(n): binary=format(n,'b') binstr='0'*(32-len(binary))+binary binstr=binstr.replace('0','2').replace('1','0').replace('2','1') return int(binstr,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: