Skip to content

Commit c063560

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

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎sorts/wiggle_sort.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ def wiggle_sort(nums: list) -> list:
2525
[-45.11, -2.1, -5.68]
2626
"""
2727
for i in range(1, len(nums)):
28-
if (i % 2 == 1 and nums[i - 1] > nums[i]) or (i % 2 == 0 and nums[i - 1] < nums[i]):
28+
if (i % 2 == 1 and nums[i - 1] > nums[i]) or (
29+
i % 2 == 0 and nums[i - 1] < nums[i]
30+
):
2931
nums[i - 1], nums[i] = nums[i], nums[i - 1]
3032

3133
return nums

0 commit comments

Comments
 (0)