@@ -0,0 +1,725 @@
+%60%60%60%0AGiven a collection of numbers that might contain duplicates, return all possible unique permutations.%0A%0AFor example,%0A%5B1,1,2%5D have the following unique permutations:%0A%5B1,1,2%5D, %5B1,2,1%5D, and %5B2,1,1%5D.%0A%60%60%60%0A%0Aclass Solution:%0A    # @param %7Binteger%5B%5D%7D nums%0A    # @return %7Binteger%5B%5D%5B%5D%7D%0A    def permuteUnique(self, nums):%0A        result = %5B%5D%0A        length = len(nums)%0A        prev = None%0A        nums.sort()%0A        if length == 1: return %5Bnums%5D%0A        if length == 0: return %5B%5D%0A        %0A        for i, num in enumerate(nums):%0A            if prev == num: continue%0A            else: prev = num%0A            for ele in self.permuteUnique(nums%5B:i%5D+nums%5Bi+1:%5D):%0A                result.append(%5Bnum%5D + ele)%0A        %0A        return result %0A

Create PermutationsII.py