还能更快?
class Solution:
def reverseBits(self, n):
one=1
res=0
for i in range(32):
res=(res<<1)+(n&one)
n=n>>1
return res
还能更快?
class Solution:
def reverseBits(self, n):
one=1
res=0
for i in range(32):
res=(res<<1)+(n&one)
n=n>>1
return res