input: Write a function to implement selection sort.
  assert selection_sort([23, 12, 45, 1, 30, 19, 7])==[1, 7, 12, 19, 23, 30, 45]
  assert selection_sort([3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5])==[1, 1, 2, 3, 3, 4, 5, 5, 5, 6, 9]
  assert selection_sort([10, 9, 8, 7, 6, 5, 4, 3, 2, 1])==[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
output: def selection_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