leetcode 46 全排列
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))