Commit 1c74951
authored
⚡️ Speed up function
Here is a much faster version. The original uses bubble sort (O(n²)), which is very slow for large lists. Python’s built-in `sort()` (Timsort, O(n log n)) is highly optimized. We’ll retain all print statements and function signature.
*All previous logic is preserved, but now the sort is many times faster, consistent with Python best practice on performance.*sorter by 51,639%1 parent 4ab32b9 commit 1c74951
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments