Skip to content
Branch: master
Find file History
Latest commit bd582ec Aug 10, 2019
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
46. Permutations.go 更改包路径 Aug 10, 2019
46. Permutations_test.go 更改包路径 Aug 10, 2019
README.md 更改包路径 Aug 10, 2019

README.md

46. 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]
]

题目大意

给定一个没有重复数字的序列,返回其所有可能的全排列。

解题思路

  • 求出一个数组的排列组合中的所有排列,用 DFS 深搜即可。
You can’t perform that action at this time.