Permutations II
Given a collection of numbers that might contain duplicates, return all possible unique permutations.
(含有重复元素的全排列)
Example:
1. 递归
按照我们平时求全排列的思路,在选取数组中的某个数时,计算剩下的数组的全排列,具体实现方法如下:
1 | class Solution: |
Given a collection of numbers that might contain duplicates, return all possible unique permutations.
(含有重复元素的全排列)
Example:
按照我们平时求全排列的思路,在选取数组中的某个数时,计算剩下的数组的全排列,具体实现方法如下:
1 | class Solution: |