@@ -0,0 +1,985 @@
+public class Solution %7B%0A    public List%3CList%3CInteger%3E%3E combinationSum2(int%5B%5D candidates, int target) %7B%0A        Arrays.sort(candidates);%0A        List%3CList%3CInteger%3E%3E answer = new ArrayList%3C%3E();%0A        List%3CInteger%3E numbers = new ArrayList%3C%3E();%0A        dfs(answer, numbers, candidates, 0, target);%0A        return answer;%0A    %7D%0A%0A    private void dfs(List%3CList%3CInteger%3E%3E answer, List%3CInteger%3E numbers, int%5B%5D candidates, int current, int target ) %7B%0A        if (target == 0) %7B%0A            answer.add(new ArrayList%3C%3E(numbers));%0A            return;%0A        %7D%0A%0A        if (target %3C 0) %7B%0A            return;%0A        %7D%0A%0A        int previous = -1;%0A        for (int i=current; i%3Ccandidates.length; i++) %7B%0A            if (candidates%5Bi%5D != previous) %7B%0A                numbers.add(candidates%5Bi%5D);%0A                dfs(answer, numbers, candidates, i+1, target - candidates%5Bi%5D);%0A                numbers.remove(numbers.size()-1);%0A                previous = candidates%5Bi%5D;%0A%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

40. Combination Sum II