input: Write a function to return an array with the greatest and smallest values from the given array.
  
  def min_max(arr):
      if len(arr) == 0: # If array is empty return an empty list
          return []
      min_val = min(arr)
      max_val = max(arr)
      return [min_val, max_val]
  
  assert min_max([3, 4, 2, 8, 15, 6]) == [2, 15]
  assert min_max([1, 1, 1, 1, 1]) == [1, 1]
  assert min_max([-10, 45, 0, -20, 30]) == [-20, 45]
  assert min_max([9]) == [9, 9]
  assert min_max([]) == []
output: def min_max(arr):
      if len(arr) == 0:
          return []
      min_val = min(arr)
      max_val = max(arr)
      return [min_val, max_val]