input: Write a python function to sort an array using selection sort algorithm.
  assert sortArray([64, 25, 12, 22, 11]) == [11, 12, 22, 25, 64]
  assert sortArray([5, 2, 9, 1, 5, 6]) == [1, 2, 5, 5, 6, 9]
  assert sortArray([3, 0, -1, 8, 7, 2, 4, -2]) == [-2, -1, 0, 2, 3, 4, 7, 8]
output: def sortArray(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