input: Write a function to sort an array using bubble sort algorithm.
  assert sort_array([2, 4, 1, 3, 7, 5]) == [1, 2, 3, 4, 5, 7]
  assert sort_array([10, 3, 15, 7, 8, 23, 74, 18]) == [3, 7, 8, 10, 15, 18, 23, 74]
  assert sort_array([5, 2, 9, 1, 5, 6]) == [1, 2, 5, 5, 6, 9]
output: def sort_array(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