# 全排列
给定一个 没有重复 数字的序列,返回其所有可能的全排列。
示例:
输入: [1,2,3]## template ```python class Solution: def permute(self, nums): e=[] if(len(nums)==1): return [nums] for i in range(len(nums)): q=self.permute(nums[:i]+nums[i+1:]) for c in q: e.append([nums[i]]+c) return e # %% s = Solution() print(s.permute(nums = [1,2,3])) ``` ## 答案 ```python ``` ## 选项 ### A ```python ``` ### B ```python ``` ### C ```python ```
输出:[ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]]