Skip to content

Commit 534fb76

Browse files
author
jinbeom
committed
시간복잡도, 공간복잡도
1 parent 64758f0 commit 534fb76

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed

contains-duplicate/kayden.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# 시간복잡도: O(N)
2+
# 공간복잡도: O(N)
13
class Solution:
24
def containsDuplicate(self, nums: List[int]) -> bool:
35
unique_nums = set(nums)

kth-smallest-element-in-a-bst/kayden.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# 시간복잡도: O(N)
2+
# 공간복잡도: O(1)
13
class TreeNode:
24
def __init__(self, val=0, left=None, right=None):
35
self.val = val

number-of-1-bits/kayden.py

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

palindromic-substrings/kayden.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# 시간복잡도: O(N^2)
2+
# 공간복잡도: O(N^2)
13
class Solution:
24
def countSubstrings(self, s: str) -> int:
35
n = len(s)

top-k-frequent-elements/kayden.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# 시간복잡도: O(Nlog N)
2+
# 공간복잡도: O(N)
13
from collections import Counter
24

35
class Solution:

0 commit comments

Comments
 (0)