classSolution:""" @param nums: A list of Integers. @return: A list of permutations. """defpermute_helper(self,result,solution,nums):iflen(nums)==0:result.append(solution[:])returnforiinrange(len(nums)):el=nums[i]solution.append(el)nums.pop(i)self.permute_helper(result,solution,nums)solution.pop()nums.insert(i,el)returndefpermute(self,nums):# write your code hereresult=[]ifnums==Noneorlen(nums)==0:returnresultself.permute_helper(result,[],nums)returnresultif__name__=="__main__":sol=Solution()sol.permute([1])