input: Write a function that takes an array of numbers and returns an array with the greatest and smallest values. Specify the function header as def min_max(arr): and use the assert statement to check the function's output. Ensure that the function handles cases with an empty array by returning an empty array.
  assert min_max([3, 4, 2, 8, 15, 6]) == [2, 15]
  assert min_max([1, 2, 3]) == [1, 3]
  assert min_max([7, 7, 7]) == [7, 7]
  assert min_max([]) == []
output: def min_max(arr):
      if not arr:
          return []
      return [min(arr), max(arr)]