take num, rev binary, return that binary's num

PHOTO EMBED

Thu Apr 22 2021 02:12:26 GMT+0000 (Coordinated Universal Time)

Saved by @clare_jackson #python

def csReverseIntegerBits(n):
   result = 0
   while n:
       result = (result << 1) + (n & 1)
       n >>= 1
   return result
content_copyCOPY