Skip to content

Commit 0160a7b

Browse files
committed
add complexity analysis
1 parent ca06932 commit 0160a7b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

combination-sum/bemelon.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
class Solution:
2+
# Space complexity: O(n)
3+
# - n: len(candidates)
4+
# - Stack Frame -> O(n)
5+
# - list_of_combination -> O(n) ?
6+
# Time complexity: O(n!)
27
def combinationSum(self, candidates: List[int], target: int) -> List[List[int]]:
38
list_of_combination = []
49
n = len(candidates)

0 commit comments

Comments
 (0)