solution.md 685 字节
Newer Older
每日一练社区's avatar
每日一练社区 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
# 全排列

<p>给定一个<strong> 没有重复</strong> 数字的序列,返回其所有可能的全排列。</p><p><strong>示例:</strong></p><pre><strong>输入:</strong> [1,2,3]<strong><br />输出:</strong>[  [1,2,3],  [1,3,2],  [2,1,3],  [2,3,1],  [3,1,2],  [3,2,1]]</pre>

## 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

```