input: Write a function to implement the selection sort algorithm, which sorts an array by continuously finding the minimum element from the unsorted part and putting it at the beginning. Return the sorted array.
  assert sort_list([1, 5, 7, 8, 4, 10, 2]) == [1, 2, 4, 5, 7, 8, 10]
  assert sort_list([3, 8, 2, 1, 5]) == [1, 2, 3, 5, 8]
  assert sort_list([]) == []
  assert sort_list([1]) == [1]
  assert sort_list([5, 3, 8, 6, 4, 2]) == [2, 3, 4, 5, 6, 8]
output: def sort_list(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