reverse bits of a given 32 bits unsigned integer for example given input 43261596 represented in binary as 00000010100101000001111010011100 return 964176192 represented in binary as 00111001011110000010100101000000
def reverse_bits(n):
    m = 0
    i = 0
    while i < 32:
        m = (m << 1) + (n & 1)
        n >>= 1
        i += 1
    return m