Skip to content

Commit 12c77c0

Browse files
committed
feat: 카운트비트 풀이
1 parent e86ad1e commit 12c77c0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

counting-bits/saysimple.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)