LeetCode46. Permutations

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.回溯法。递归。每次交换num中的两个数字。
相关文章
相关标签/搜索