1-line Python Solution


  • 0
    class Solution(object):
        def hammingWeight(self, n):
            return bin(n).count('1')
        """
        :type n: int
        :rtype: int
        """

  • -2

    真是厉害,这样的简单的代码都能想的出来,真是佩服,太简单了!!!!!!!!!!!!!!!


Log in to reply
 

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