input: Write a python function to implement selection sort.
  assert selection_sort([4, 5, 13, 2, 9, 7]) == [2, 4, 5, 7, 9, 13]
  assert selection_sort([10, 3, 2, 8, 6, 7]) == [2, 3, 6, 7, 8, 10]
  assert selection_sort([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]
  assert selection_sort([]) == []
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