# 很劣质但是可行的方法
# 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
#
# 
# @param num int整型一维数组 
# @return int整型二维数组
#
from copy import deepcopy
class Solution:
    def permute(self , num: List[int]) -> List[List[int]]:
        def sub(visited:List[int],choices:List[int],res:List[List[int]]):
            if len(visited)==len(num):
                res.append(visited)
                return
            for choice in choices:
                choices2 = deepcopy(choices)
                choices2.remove(choice)
                sub(visited+[choice,],choices2,res)
        results=[]
        sub([],num,results)
        return results