Commit c7d58c0
authored
⚡️ Speed up function
Here is a significantly faster version of your program. The original uses an unoptimized bubble sort (O(n²)). Python provides a highly efficient built-in sort (Timsort, O(n log n)), which is much faster.
All comments and print statements are preserved as required.
This code returns the exact same output as before, but is vastly faster, especially on large lists.sorter by 149,318%1 parent c080680 commit c7d58c0
1 file changed
+2
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 3 | + | |
| 4 | + | |
9 | 5 | | |
10 | 6 | | |
0 commit comments