Leetcode Algorithms -- Permutations
Permutations (Medium)
Description
Given a collection of 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], and [3,2,1].
Analysis
= =。算法书上讲的例题。。其实可以直接用next_permutation
复习一下。
My Solution
1 | //C++ |