mirror of
https://github.com/devenperez/leetcode.git
synced 2026-06-15 09:57:09 +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 = []
|
permutations = []
|
||||||
for i in range(len(nums)):
|
for i in range(len(nums)):
|
||||||
permutations += permute_with_prefix(nums[:i] + nums[(i + 1):], # Remove the ith element from nums
|
permutations.extend(permute_with_prefix(nums[:i] + nums[(i + 1):], # Remove the ith element from nums
|
||||||
prefix + [nums[i]])
|
prefix + [nums[i]]))
|
||||||
return permutations
|
return permutations
|
||||||
|
|
||||||
# Initial call
|
# Initial call
|
||||||
|
|||||||
Reference in New Issue
Block a user