# Permutations (Leetcode 46)

Problem Link: <https://leetcode.com/problems/permutations/>

```python
class Solution:
    def permute(self, nums: List[int]) -> List[List[int]]:
        
        if(len(nums)==1):
            return [[nums[0]]]
        
        ans=[]
        for i in range(len(nums)):
            char=nums[i]
            ros=nums[:i]+nums[i+1:]
            tempAns=self.permute(ros)
            for i in tempAns:
                i.insert(0,char)
                ans.append(i)
        return ans
```
