Skip to content

Commit

Permalink
⚡️ Speed up function sorter by 4211531.56 in PR #144 (`davidgirdwoo…
Browse files Browse the repository at this point in the history
…d1-patch-2`)

Test Dave:
  • Loading branch information
codeflash-ai[bot] authored Feb 14, 2025
1 parent 2f1a879 commit 4a9f898
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bubble_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ def sorter(arr):


def sorter2(arr):
for i in range(len(arr)):
for i in range(len(arr)-1):
for j in range(len(arr) - 1):
if arr[j] > arr[j + 1]:
temp = arr[j]
arr[j] = arr[j + 1]
arr[j + 1] = temp
return arr
return arr

0 comments on commit 4a9f898

Please sign in to comment.