(int[] candidates, int target)
| 3 | List<List<Integer>> answer = new ArrayList<List<Integer>>(); |
| 4 | |
| 5 | public List<List<Integer>> combinationSum(int[] candidates, int target) { |
| 6 | int clen =candidates.length; |
| 7 | for (int i = 0; i < clen; i++) { |
| 8 | List<Integer> tlist = new ArrayList<Integer>(); |
| 9 | tlist.add(candidates[i]); |
| 10 | backtracking(candidates, i, 1, (target - candidates[i]), tlist); |
| 11 | } |
| 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)); |
nothing calls this directly
no test coverage detected