input: Write a function to sort a list of numbers using selection sort algorithm. If the given array is empty then return an empty list.
  assert sort_list([4, 2, 6, 7, 1])==[1, 2, 4, 6, 7]
  assert sort_list([])==[]
output: def sort_list(arr):
      if not arr:
          return []
      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