Skip to content

Commit 2daa9b6

Browse files
committed
Update Number of 1 Bits.py
1 parent fee2b1f commit 2daa9b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Number of 1 Bits.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ class Solution:
22
def hammingWeight(self, n):
33
count = 0
44
while n:
5-
count += 1;
6-
n = (n-1) & n
5+
count += 1
6+
n = (n - 1) & n
77
return count

0 commit comments

Comments
 (0)