题目:46. 全排列
链接:https://leetcode-cn.com/problems/permutations/description/
给定一个list(无重复元素),返回其全排列。
python:
import itertools
class Solution:
def permute(self, nums):
"""
:type nums: List[int]
:rtype: List[List[int]]
"""
return list(itertools.permutations(nums))
其他没有这个函数的深搜就行吧。