We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a438306 commit ed58632Copy full SHA for ed58632
data_structures/arrays/permutations.py
@@ -10,7 +10,7 @@ def permute_recursive(nums: list[int]) -> list[list[int]]:
10
return [[]]
11
for _ in range(len(nums)):
12
n = nums.pop(0)
13
- permutations = permute_recursive(nums)
+ permutations = permute_recursive(nums.copy())
14
for perm in permutations:
15
perm.append(n)
16
result.extend(permutations)
0 commit comments