46 Permutations
46. Permutations
1. Question
Given a collection of distinct numbers, return all possible permutations.
For example,
[1,2,3]
have the following permutations:
2. Implementation
(1) Backtracking
3. Time & Space Complexity
Backtracking: 时间复杂度O(n!), 空间复杂度O(n!)
Last updated
Was this helpful?