public List<List<Integer>> permuteUnique(int[] nums) {
        if (nums == null || nums.length == 0)
            return result;
        Arrays.sort(nums);
        int[] visited = new int[nums.length];
        backtrack(result, list, visited, nums);
        return result;
    }