Skip to content

Commit 14c1f05

Browse files
author
eunhwa99
committed
combination sum 설명추가
1 parent e8f647c commit 14c1f05

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

combination-sum/eunhwa99.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ private void backtrack(int[] candidates, int target, int start, List<Integer> cu
3131
}
3232
}
3333

34+
// 시간 복잡도: O(2^(target)) - 각 후보 숫자가 target을 만드는 데에 기여할 수도 있고 안 할 수도 있음
35+
// 공간 복잡도: O(k * t) - k는 가능한 조합의 수, t는 각 조합의 크기
3436
class newSolution{
3537
public List<List<Integer>> combinationSum(int[] candidates, int target) {
3638
List<List<Integer>> result = new ArrayList<>();
@@ -52,3 +54,4 @@ private void backtrack(List<List<Integer>> result, List<Integer> tempList, int[]
5254
}
5355
}
5456
}
57+

0 commit comments

Comments
 (0)