###### 【LeetCode-47】Permutations II

public class PermutationsII {

private List<List<Integer>> res = new ArrayList<List<Integer>>();
private List<Integer> temp = new ArrayList<Integer>();
private Set<List<Integer>> tempRes = new HashSet<List<Integer>>();

public List<List<Integer>> permuteUnique(int[] nums)  {

if(nums == null || nums.length == 0){
return res;
}

permuteAssist(nums, 0);

//将tempRes中的结果存储到res
Iterator<List<Integer>> iterator = tempRes.iterator();
while(iterator.hasNext()){
}

return res;
}

//将数组转换成链表
private void convert(int[] nums){
for(int i = 0;i < nums.length;i ++){
}
}

private void permuteAssist(int[] nums,int index){
if(index >= nums.length){
convert(nums);
temp = new ArrayList<Integer>();
return;
}

for(int i = index;i < nums.length;i ++){

int temp = nums[index];
nums[index] = nums[i];
nums[i] = temp;

permuteAssist(nums, index + 1);

temp = nums[index];
nums[index] = nums[i];
nums[i] = temp;
}
}
}


#### [leetcode]47. Permutations II,python实现

2016-06-16 16:24:48

#### Leetcode-47: Permutations II

2018-04-06 12:20:39

#### [leetcode-47]Permutations II(java)

2015-08-02 17:27:11

#### 【leetcode】【47】Permutations II

2016-03-01 10:17:28

#### 47. Permutations II | Java最短代码实现

2016-03-20 21:15:43

#### Permutations II -- LeetCode

2014-03-20 01:04:36

#### Leetcode 47. Permutations II

2016-03-28 21:46:07

#### [LeetCode]47.Permutations II

2015-01-19 12:21:00

#### leetcode 47. Permutations II-排列|回溯算法

2016-06-12 15:11:12

#### Leetcode Problem.47—Permutations II C++实现

2015-06-05 13:09:53

## 不良信息举报

【LeetCode-47】Permutations II