input: Write a function to implement bubble sort.
  assert bubble_sort([1, 8, 4, 6, 2, 5]) == [1, 2, 4, 5, 6, 8]
  assert bubble_sort([9, 7, 5, 3, 1]) == [1, 3, 5, 7, 9]
  assert bubble_sort([10, 3, 15, 7, 8, 23, 74, 18]) == [3, 7, 8, 10, 15, 18, 23, 74]
output: def bubble_sort(arr):
      n = len(arr)
      for i in range(n):
          for j in range(0, n-i-1):
              if arr[j] > arr[j+1]:
                  arr[j], arr[j+1] = arr[j+1], arr[j]
      return arr