天天看點

【LeetCode】Permutations

Given a collection of numbers, return all possible permutations.

For example,

<code>[1,2,3]</code> have the following

permutations:

<code>[1,2,3]</code>, <code>[1,3,2]</code>, <code>[2,1,3]</code>, <code>[2,3,1]</code>, <code>[3,1,2]</code>,

and <code>[3,2,1]</code>.