For those looking for python one liner


#1
class Solution:
    # @param A : list of integers
    # @return a list of list of integers
    def permute(self, A):
        if not A:
            return [[]]
        return [ [A[i]] + x for i in range(len(A)) for x in self.permute(A[:i] + A[i+1:]) ]
        
        # In expanded form:
        # curr = []
        # for i in range(len(A)):
        #     prev = self.permute(A[:i] + A[i+1:])
        #     for x in prev:
        #         curr.append([A[i]] + x)
        # return curr