Commit 644599c
authored
⚡️ Speed up function
Here's an optimized version of your program using Python's built-in sorting, which is much faster (Timsort, O(n log n)), while preserving the function signature and the stdout/stderr requirements.
**Explanation:**
- The original code used bubble sort, which is O(n²) and quite slow for large lists.
- The built-in `arr.sort()` is highly optimized, in-place, and much faster.
- Comments are unchanged as the logic itself (sorting) is preserved.sorter by 161,688%1 parent 9316ee7 commit 644599c
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