input: Write a function to return an array with the greatest and smallest values from the given array. If the input array is empty, return an empty array.
  
  assert min_max([3, 4, 2, 8, 15, 6]) == [2, 15]
  assert min_max([]) == []
  assert min_max([5, -2, 0, 10]) == [-2, 10]
  assert min_max([7]) == [7, 7]
  assert min_max([-1, -3, -5, -1]) == [-5, -1]
output: def min_max(arr):
      if not arr:
          return []
      return [min(arr), max(arr)]