|
|
|
@ -30,9 +30,15 @@ class Solution {
|
|
|
|
|
if (!set.contains(candidates[i]) && target >= candidates[i]) {
|
|
|
|
|
stack.push(candidates[i]);
|
|
|
|
|
helper(candidates, target - candidates[i], i + 1, stack, res);
|
|
|
|
|
System.out.println(stack + "before");
|
|
|
|
|
stack.pop();
|
|
|
|
|
System.out.println(stack + "after");
|
|
|
|
|
set.add(candidates[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
new Solution().combinationSum2(new int[]{10, 1, 2, 7, 6, 1, 5}, 8);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|