(left: list[Any], right: list[Any])
| 28 | |
| 29 | |
| 30 | def merge(left: list[Any], right: list[Any]) -> list[Any]: |
| 31 | if not left: |
| 32 | return right |
| 33 | |
| 34 | if not right: |
| 35 | return left |
| 36 | |
| 37 | if left[0] < right[0]: |
| 38 | return [left[0], *merge(left[1:], right)] |
| 39 | |
| 40 | return [right[0], *merge(left, right[1:])] |
| 41 | |
| 42 | |
| 43 | def tim_sort(lst: list[Any] | tuple[Any, ...] | str) -> list[Any]: |
no outgoing calls
no test coverage detected