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