python solution with 32ms


  • 0
    M
    class Solution:
        # @param n, an integer
        # @return an integer
        def reverseBits(self, n):
            temp = bin(n)[2:].zfill(32)
            return int(temp[::-1],2)            
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.