```
class Solution:
# @param num, a list of integer
# @return a list of lists of integers
def permute(self, num):
if len(num) <= 1:
return [num]
perms = []
for idx, ele in enumerate(num):
for permutation in self.permute(num[:idx] + num[idx+1:]):
perms.append([ele] + permutation)
return perms
```

This was accepted in leetcode. However I will appreciate any suggestion to improve the performance.