mirror of
https://github.com/devenperez/leetcode.git
synced 2026-06-13 14:57:08 +00:00
Time: 37 ms (93.95%), Space: 13.9 MB (97.39%) - LeetHub
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user