public List<List<Integer>> permuteUnique(int[] nums) {
        List<List<Integer>> res = new ArrayList<List<Integer>>();
        List<Integer> candidates = new ArrayList<Integer>();
        Arrays.sort(nums);
        for (int i : nums)
            candidates.add(i);
        dfs(res, candidates, 0);
        return res;
    }