Skip to content

Commit bddde12

Browse files
committed
feat: TC, SC 추가
1 parent 14d1529 commit bddde12

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed

counting-bits/saysimple.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# TC: O(n), SC: O(n)
2+
13
class Solution:
24
def countBits(self, n: int) -> List[int]:
35
answer = []

group-anagrams/saysimple.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# TC: O(n), SC: O(n)
2+
13
from collections import defaultdict
24

35
class Solution:

missing-number/saysimple.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# TC: O(n), SC: O(1)
2+
13
class Solution:
24
def missingNumber(self, nums: List[int]) -> int:
35
for i in range(len(nums)+1):

number-of-1-bits/saysimple.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# TC: O(1), SC: O(1)
2+
13
class Solution:
24
def hammingWeight(self, n: int) -> int:
35
return bin(n).count("1")

reverse-bits/saysimple.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# TC: O(1), SC: O(1)
2+
13
class Solution:
24
def reverseBits(self, n: int) -> int:
35
return int(f"{bin(n)[2:]:0>32}"[::-1], 2)

0 commit comments

Comments
 (0)