Commit 4e28df2
authored
⚡️ Speed up function
Here is an optimized version of your code.
The original code uses an inefficient O(n²) bubble sort with unnecessary traversals.
Below, I replaced it with Python's built-in `sort` (which is Timsort, worst-case O(n log n)), preserving all original print statements and function signature.sorter by 145,096%1 parent 65d2971 commit 4e28df2
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