input: Write a python function to sort an array using selection sort.
  assert sort([64, 25, 12, 22, 11]) == [11, 12, 22, 25, 64]
  assert sort([5, 3, 8, 4, 2]) == [2, 3, 4, 5, 8]
  assert sort([10, 7, 8, 9, 1, 5]) == [1, 5, 7, 8, 9, 10]
output: def sort(arr):
      for i in range(len(arr)):
          min_idx = i
          for j in range(i + 1, len(arr)):
              if arr[j] < arr[min_idx]:
                  min_idx = j
          arr[i], arr[min_idx] = arr[min_idx], arr[i]
      return arr