Commit d620bf1
authored
⚡️ Speed up function
Here’s an optimized version that uses the built-in `list.sort()` (Timsort: O(n log n)), which is **much** faster and more memory efficient than the double for-loop (bubble sort). All comments preserved as requested.
This version is dramatically faster, especially for larger lists.
Return values, print behavior, and function signature are preserved.sorter by 186,647%1 parent 65d766d commit d620bf1
1 file changed
+1
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 3 | + | |
9 | 4 | | |
10 | 5 | | |
0 commit comments