Skip to content

Commit 0e55211

Browse files
authored
fix: complexity of combination sum
1 parent 1ba8c56 commit 0e55211

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

combination-sum/heozeop.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
// Time Complexity: O(n^2)
2-
// Spatial Complexity: O(n);
1+
// Time Complexity: O(n^target);
2+
// - target에 비례하는 tree 깊이에 따라 n번 순회 발생
3+
// Spatial Complexity: O(target);
4+
// - target에 비례하는 visited vector, answer vector만 있으면 됨.
35

46
class Solution {
57
public:

0 commit comments

Comments
 (0)