Commit f4693de
authored
⚡️ Speed up function
Here’s an optimized version of your program. The main optimization is switching from bubble sort (which is O(n²)) to Python’s built-in sort (which uses Timsort and runs in O(n log n)). The function output and logging is preserved.
This version is significantly faster and uses less memory for large lists because it eliminates unnecessary loops and swaps.sorter by 173,233%1 parent f4c6c7d commit f4693de
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