input: Write a python function to sort an array using the selection sort algorithm.
  assert sort_nums([125, 33, 52, 45, 24])==[24, 33, 45, 52, 125]
  assert sort_nums([5, 4, 3, 2, 1])==[1, 2, 3, 4, 5]
  assert sort_nums([1, 2, 3, 4, 5])==[1, 2, 3, 4, 5]
  assert sort_nums([3, 0, -2, 4, -1])==[-2, -1, 0, 3, 4]
output: def sort_nums(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