(int[] candidates, int index, int tsize, int target, List<Integer> temp)
| 12 | return answer; |
| 13 | } |
| 14 | private void backtracking(int[] candidates, int index, int tsize, int target, List<Integer> temp) { |
| 15 | if (target == 0) { |
| 16 | answer.add(new ArrayList(temp)); |
| 17 | return; |
| 18 | } |
| 19 | |
| 20 | for (int i = index, len = candidates.length; i < len; i++) { |
| 21 | if (candidates[i] <= target) { |
| 22 | temp.add(candidates[i]); |
| 23 | backtracking(candidates, i, (tsize + 1), (target - candidates[i]), temp); |
| 24 | temp.remove(tsize); |
| 25 | } |
| 26 | } |
| 27 | } |
| 28 | } |
| 29 |
no test coverage detected