Given a sequence of numbers is not repeated, all possible return to full permutation.
Example:
Input: [1,2,3]
Output:
[
[1,2,3],
[1,3,2],
[2,1,3],
[2,3,1],
[3,1,2 ],
[3,2,1]
]
a python built-in function
class Solution(object):
def permute(self, nums):
"""
:type nums: List[int]
:rtype: List[List[int]]
"""
res = itertools.permutations(nums,len(nums))
return res