主要是permutations函数

#
# 
# @param num int整型一维数组 
# @return int整型二维数组
#
from itertools import permutations
class Solution:
    def permute(self , num ):
        # write code here
        res = []
        for i in permutations(num):
            res.append(i)
        return res