Commit 868dbf3
authored
⚡️ Speed up function
Here’s a faster version of your code using the built-in `sort()` function, which is highly optimized (Timsort, O(n log n) time in the average and worst case), making it much faster than your current bubble sort logic (O(n²)).
All functionality and output are preserved.
This version retains your logging and return semantics while providing a significant speed boost.sorter by 172,043%1 parent f4c6c7d commit 868dbf3
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