Skip to content

Commit 74346aa

Browse files
committed
update
1 parent bcceb27 commit 74346aa

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

Python/combination-sum-ii.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# # Time: O(n)
2-
# # Space: O(n)
1+
# Time: O(n! / m!(n-m)!)
2+
# Space: O(m)
33
#
44
# Given a collection of candidate numbers (C) and a target number (T),
55
# find all unique combinations in C where the candidate numbers sums to T.
@@ -40,4 +40,4 @@ def combinationSumDFS(self, candidates, result, start, intermediate, target):
4040
if __name__ == "__main__":
4141
candidates, target = [10, 1, 2, 7, 6, 1, 5], 8
4242
result = Solution().combinationSum2(candidates, target)
43-
print result
43+
print result

Python/combination-sum.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Time: O(n)
2-
# Space: O(n)
1+
# Time: O(n^m)
2+
# Space: O(m)
33
#
44
# Given a set of candidate numbers (C) and a target number (T),
55
# find all unique combinations in C where the candidate numbers sums to T.
@@ -35,4 +35,4 @@ def combinationSumDFS(self, candidates, result, start, intermediate, target):
3535
if __name__ == "__main__":
3636
candidates, target = [2, 3, 6, 7], 7
3737
result = Solution().combinationSum(candidates, target)
38-
print result
38+
print result

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ Problem | Solution | Time | Space | Difficul
283283
--------------- | --------------- | --------------- | --------------- | -------------- | -----
284284
[Balanced Binary Tree] | [balanced-binary-tree.py] | _O(n)_| _O(logn)_| Easy |
285285
[Binary Tree Maximum Path Sum]| [binary-tree-maximum-path-sum.py] | _O(n)_| _O(logn)_| Hard |
286-
[Combination Sum]| [combination-sum.py] | _O(n)_ | _O(n)_ | Medium |
287-
[Combination Sum II]| [combination-sum-ii.py]| _O(n)_| _O(n)_ | Medium |
286+
[Combination Sum]| [combination-sum.py] | _O(n^m)_ | _O(m)_ | Medium |
287+
[Combination Sum II]| [combination-sum-ii.py]| _O(n! / m!(n-m)!)_| _O(m)_ | Medium |
288288
[Combinations]| [combinations.py] | _O(n!)_ | _O(n)_ | Medium |
289289
[Generate Parentheses]| [generate-parentheses.py]| _O(4^n / n^(3/2))_ | _O(n)_ | Medium |
290290

0 commit comments

Comments
 (0)