Time: 37 ms (93.95%), Space: 13.9 MB (97.39%) - LeetHub

This commit is contained in:
Deven
2023-01-13 19:58:07 -05:00
parent 4ab93c57bb
commit 3e54bb93be
+2 -2
View File
@@ -7,8 +7,8 @@ class Solution:
permutations = []
for i in range(len(nums)):
permutations += permute_with_prefix(nums[:i] + nums[(i + 1):], # Remove the ith element from nums
prefix + [nums[i]])
permutations.extend(permute_with_prefix(nums[:i] + nums[(i + 1):], # Remove the ith element from nums
prefix + [nums[i]]))
return permutations
# Initial call