codeflash/code_to_optimize/bubble_sort.py
2025-08-06 03:40:06 +03:00

10 lines
308 B
Python

def sorter(arr):
print("codeflash stdout: Sorting list")
for i in range(len(arr)):
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
print(f"result: {arr}")
return arr