Commit 07bcf1a
Fix stalin_sort raising IndexError on an empty list
The function read sequence[0] unconditionally. Return an empty list for empty
input and add doctests for the empty and single-element cases.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent 2acda52 commit 07bcf1a
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
35 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
36 | 45 | | |
37 | 46 | | |
38 | 47 | | |
| |||
0 commit comments