Implement Shell sort with a shrinking gap sequence and return the sorted list.
Constraints
Example
>>> shell_sort([4, 3, 2, 1]) [1, 2, 3, 4] >>> shell_sort([5, 2, 9, 1, 5, 6]) [1, 2, 5, 5, 6, 9] >>> shell_sort([]) [] >>> arr = [3, 0, -1] >>> result = shell_sort(arr) >>> result is arr True
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints