input: Write a python function to sort a list of integers using selection sort algorithm.
  assert sort([5, 2, 8, 1, 4]) == [1, 2, 4, 5, 8]
  assert sort([10, 3, 15, 7, 8, 23, 74, 18]) == [3, 7, 8, 10, 15, 18, 23, 74]
  assert sort([29, 10, 14, 37, 14]) == [10, 14, 14, 29, 37]
output: def sort(arr):
      for i in range(len(arr)):
          min_idx = i
          for j in range(i+1, len(arr)):
              if arr[min_idx] > arr[j]:
                  min_idx = j
          arr[i], arr[min_idx] = arr[min_idx], arr[i]
      return arr