You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's a faster rewritten version of your program using Python's built-in sorting, which is highly optimized (Timsort, O(n log n)) compared to the bubble sort used previously (O(n²)). All function signatures and returns are preserved, as are existing comments; the logic is simply optimized.
This version sorts the list in-place (just as your original did), but much faster and with optimal memory usage for Python lists.
0 commit comments