Python内置的全排列函数
class Solution(object): def permute(self, nums): """ :type nums: List[int] :rtype: List[List[int]] """ from itertools import permutations return list(permutations(nums))
Python内置的全排列函数
class Solution(object): def permute(self, nums): """ :type nums: List[int] :rtype: List[List[int]] """ from itertools import permutations return list(permutations(nums))
转载于:https://www.cnblogs.com/woshizhizhang/p/10848022.html