Skip to content

Commit 4012c49

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent eb72cc3 commit 4012c49

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

sorts/cyclic_sort.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def cyclic_sort(nums: list[int]) -> list[int]:
2828
[]
2929
>>> cyclic_sort([3, 5, 2, 1, 4])
3030
[1, 2, 3, 4, 5]
31-
31+
3232
>>> cyclic_sort([1, 2, 2])
3333
Traceback (most recent call last):
3434
...
@@ -61,8 +61,8 @@ def cyclic_sort(nums: list[int]) -> list[int]:
6161
correct_index = nums[index] - 1
6262

6363
if index != correct_index:
64-
nums[index], nums[correct_index] = nums[correct_index], nums[index]
65-
64+
nums[index], nums[correct_index] = nums[correct_index], nums[index]
65+
6666
else:
6767
index += 1
6868

0 commit comments

Comments
 (0)