47Permutations II
在46的基础上改改就能通过了
https://www.cnblogs.com/mangmangbiluo/p/10154417.html
def permuteUnique(self, nums): """ :type nums: List[int] :rtype: List[List[int]] """ result = [[]] for i, num in enumerate(nums): result = [line[:j]+[num]+line[j:] for j in range(i+1) for line in result] result.sort() linetmp = None tmp = [] for line in result: if line != linetmp: tmp.append(line) linetmp = line result = tmp return result