public ArrayList<ArrayList<Integer>> combinationSum2(int[] num,
                int target) {
            ArrayList<ArrayList<Integer>> ans = new ArrayList<ArrayList<Integer>>();
            if (num.length == 0) {
                return ans;
            }
            Arrays.sort(num);
            List<Integer> nums = new ArrayList<Integer>();
            List<Integer> counts = new ArrayList<Integer>();
            int count = 1;
            int i = 1;
            for (; i < num.length; i++) {
                if (num[i] != num[i - 1]) {
                    nums.add(num[i - 1]);
                    counts.add(count);
                    count = 1;
                } else {
                    count++;
                }

            }
            nums.add(num[i - 1]);
            counts.add(count);
            search(nums, counts, 0, target, new ArrayDeque<Integer>(), ans);
            return ans;
        }