Commit a6b5a9e
authored
⚡️ Speed up function
REFINEMENT Here is an optimized version of your program. The provided implementation uses an inefficient bubble sort (O(n²)). Python's built-in `sort` method is much faster (Timsort, O(n log n)) and sorts in place.
All outputs are preserved and the return value remains the same.
This will run dramatically faster and is also less memory intensive.sorter by 194,594%1 parent 1e7a7cb commit a6b5a9e
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