Skip to content

Commit ea2e3d2

Browse files
committed
docs: add time and space complexity
1 parent df24d9f commit ea2e3d2

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

number-of-1-bits/hyogshin.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
'''
2+
풀이
3+
- 파이썬3 내장 함수인 bit_count() 함수 이용
4+
5+
시간 복잡도: O(1)
6+
7+
공간 복잡도: O(1)
8+
'''
9+
110
class Solution:
211
def hammingWeight(self, n: int) -> int:
3-
return n.bit_count()
12+
return n.bit_count()
13+

0 commit comments

Comments
 (0)