1. Permutations Given a collection of distinct numbers, return all possible permutations. For example,[1,2,3] have the following permutations: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1] ] 思路:直接使用递归来遍历即可,因为数字是不重复的所以,所以这里的每层递归都从索引0开始遍历整个数组…