This commit is contained in:
krahets
2023-09-02 23:53:33 +08:00
parent 503ca797b8
commit ca7b5c0ac2
12 changed files with 117 additions and 50 deletions
+3 -3
View File
@@ -1239,10 +1239,10 @@ comments: true
/* 求解子集和 II */
vector *subsetSumII(vector *nums, int target) {
vector *state = newVector(); // 状态(子集)
vector *state = newVector(); // 状态(子集)
qsort(nums->data, nums->size, sizeof(int *), comp); // 对 nums 进行排序
int start = 0; // 子集和
vector *res = newVector(); // 结果列表(子集列表)
int start = 0; // 子集和
vector *res = newVector(); // 结果列表(子集列表)
backtrack(state, target, nums, start, res);
return res;
}