Skip to content

Commit 06fcd14

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

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sorts/cyclic_sort.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
python cyclic_sort.py
1010
"""
1111

12+
1213
def cyclic_sort(nums: list) -> list:
1314
"""
1415
Sorts the input list in-place using the Cyclic Sort algorithm.
@@ -32,7 +33,7 @@ def cyclic_sort(nums: list) -> list:
3233
while i < len(nums):
3334
# Calculate the correct index for the current element
3435
correct_index = nums[i] - 1
35-
36+
3637
# If the current element is not at its correct position,
3738
# swap it with the element at its correct index
3839
if nums[i] != nums[correct_index]:
@@ -44,6 +45,7 @@ def cyclic_sort(nums: list) -> list:
4445

4546
return nums
4647

48+
4749
if __name__ == "__main__":
4850
import doctest
4951

0 commit comments

Comments
 (0)