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] ] 这题是列举所有情况,回溯. 每次都是从头开始遍历,往集合中添加元素,但是添加过的元素就不能再添加进去了,所以每次遍历就要判断当前元素…