I feel like I'm cheating (1 line Python solution with 29ms)


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

Log in to reply
 

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