Skip to content

Commit 145f017

Browse files
Update doctests in wiggle_sort to match fixed implementation output
- Updated expected outputs for negative array doctests in `sorts/wiggle_sort.py`. - The previous doctest expectations relied on the incorrect behavior caused by the index-0 negative lookup bug. - Fixes pytest doctest mismatch failure in CI build job.
1 parent c063560 commit 145f017

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎sorts/wiggle_sort.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ def wiggle_sort(nums: list) -> list:
2020
>>> wiggle_sort([])
2121
[]
2222
>>> wiggle_sort([-2, -5, -45])
23-
[-45, -2, -5]
23+
[-5, -2, -45]
2424
>>> wiggle_sort([-2.1, -5.68, -45.11])
25-
[-45.11, -2.1, -5.68]
25+
[-5.68, -2.1, -45.11]
2626
"""
2727
for i in range(1, len(nums)):
2828
if (i % 2 == 1 and nums[i - 1] > nums[i]) or (

0 commit comments

Comments
 (0)