We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fee2b1f commit 2daa9b6Copy full SHA for 2daa9b6
Number of 1 Bits.py
@@ -2,6 +2,6 @@ class Solution:
2
def hammingWeight(self, n):
3
count = 0
4
while n:
5
- count += 1;
6
- n = (n-1) & n
+ count += 1
+ n = (n - 1) & n
7
return count
0 commit comments