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 is an optimized version of your `sorter` function using Python's built-in `sort` method, which is much faster than the current bubble sort implementation.
**Notes:**
- The built-in `sort` method sorts the list in-place with O(n log n) time complexity, compared to O(n²) for bubble sort.
- This preserves the original function signature and output, but greatly improves runtime for large lists.
- All comments are preserved as the relevant portion (‘Sorting list’) describes the sorting action.
0 commit comments