Skip to content
This repository was archived by the owner on Apr 20, 2024. It is now read-only.

Commit e6d685b

Browse files
committed
updated python solution for problem67
1 parent 9c555c5 commit e6d685b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

problem67/Solution1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ def countBits(self, n: int) -> List[int]:
44
for i in range(n+1):
55
ones = 0
66
while i != 0:
7-
if i & 1 == 1: ones += 1
7+
ones += i&1
88
i >>= 1
99
ans.append(ones)
1010
return ans

0 commit comments

Comments
 (0)