input: Write a function to sort an array of numbers in ascending order using bubble sort.
  assert sort_arr([9, 4, 6, 1, 3, 7]) == [1, 3, 4, 6, 7, 9]
  assert sort_arr([3, 1, 2]) == [1, 2, 3]
  assert sort_arr([5, 5, 5, 2, 1]) == [1, 2, 5, 5, 5]
  assert sort_arr([-1, -4, 3, 2]) == [-4, -1, 2, 3]
output: def sort_arr(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