input: Write a function to implement selection sort.
  assert selection_sort([64, 25, 12, 22, 11]) == [11, 12, 22, 25, 64]
  assert selection_sort([5, 3, 8, 4, 2]) == [2, 3, 4, 5, 8]
  assert selection_sort([29, 10, 14, 37, 13]) == [10, 13, 14, 29, 37]
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