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] ]思路:反复交换,直到最后一位数字。
全排列
原文:https://www.cnblogs.com/zzas0/p/10557282.html