input: Write a function that takes an array of numbers and returns an array with the greatest and smallest values. The function header should be `def min_max(arr)`. Use the following assert statements to test the function:
  
  assert min_max([3, 4, 2, 8, 15, 6]) == [2, 15]
  assert min_max([7, 2, 8, 3, 10, 5]) == [2, 10]
  assert min_max([1, 2, 3, 4, 5]) == [1, 5]
  assert min_max([5, 3, 1, 2, 4]) == [1, 5]
  assert min_max([]) == []
  
  The function should return an empty list if the input array is empty.
output: def min_max(arr):
      if not arr:
          return []
      return [min(arr), max(arr)]