说明:一.问题描述
Given a collection of distinct integers, return all possible permutations.
Example:
Input: [1,2,3]
Output:
[
[1,2,3],
[1,3,2],
[2,1,3],
[2,3,1],
[3,1,2],
[3,2,1]
]
二.解题思路
主要是有两种思路:
1,数组长度为n,后面i~n的子数组已完成全排列,我们慢慢向前推进,接下来把nums[i-1]加进
<weixin_38502183> 上传 | 大小:44kb