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 e86ad1e commit 12c77c0Copy full SHA for 12c77c0
counting-bits/saysimple.py
@@ -0,0 +1,9 @@
1
+class Solution:
2
+ def countBits(self, n: int) -> List[int]:
3
+ answer = []
4
+
5
+ for i in range(n+1):
6
+ b = bin(i)
7
+ answer.append(int(b.count("1")))
8
9
+ return answer
0 commit comments