Skip to content

Commit fa01d41

Browse files
authored
Update Permutations - Leetcode 46.py
1 parent ca42d8c commit fa01d41

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
class Solution:
22
def permute(self, nums: List[int]) -> List[List[int]]:
33
n = len(nums)
4-
res, sol = [], []
4+
ans, sol = [], []
55

66
def backtrack():
77
if len(sol) == n:
8-
res.append(sol[:])
8+
ans.append(sol[:])
99
return
1010

1111
for x in nums:
@@ -15,7 +15,7 @@ def backtrack():
1515
sol.pop()
1616

1717
backtrack()
18-
return res
18+
return ans
1919

2020
# Time Complexity: O(n!)
2121
# Space Complexity: O(n)

0 commit comments

Comments
 (0)