Wow, beat 100.00% python


  • 0
    F

    can't believe, the idea is very simple:

    class Solution(object):
        def reverseBits(self, n):
            """
            :type n: int
            :rtype: int
            """
            return int('{0:032b}'.format(n)[::-1], 2)
    

Log in to reply
 

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