input: Write a function to sort an array using selection sort.
  assert sortArray([9, 8, 2, 4, 5, 7, 0]) == [0, 2, 4, 5, 7, 8, 9]
  assert sortArray([10, 3, 15, 7, 8, 23, 74, 18]) == [3, 7, 8, 10, 15, 18, 23, 74]
  assert sortArray([1, 1, 1, 1, 1]) == [1, 1, 1, 1, 1]
output: def sortArray(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