input: Write a python function to sort an array using selection sort algorithm.
  assert sort([64, 25, 12, 22, 11]) == [11, 12, 22, 25, 64]
  assert sort([5, 3, 8, 6, 2]) == [2, 3, 5, 6, 8]
  assert sort([10, 9, 8, 7, 6]) == [6, 7, 8, 9, 10]
output: def sort(arr):
      n = len(arr)
      for i in range(n):
          min_idx = i
          for j in range(i+1, n):
              if arr[j] < arr[min_idx]:
                  min_idx = j
          arr[i], arr[min_idx] = arr[min_idx], arr[i]
      return arr