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 727b537 commit 847e510Copy full SHA for 847e510
counting-bits/mangodm-web.py
@@ -0,0 +1,11 @@
1
+from typing import List
2
+
3
4
+class Solution:
5
+ def countBits(self, n: int) -> List[int]:
6
+ answer = [0]
7
8
+ for i in range(1, n + 1):
9
+ answer.append(answer[i // 2] + i % 2)
10
11
+ return answer
0 commit comments