input: Write a function that takes an array of numbers and returns an array with the greatest and smallest values. If the input array is empty, it should return an empty array.
  def min_max(arr):
    if not arr:
      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([10, 20, 5])==[5, 20]
  assert min_max([42])==[42, 42]
  assert min_max([])==[]
  assert min_max([9, 5, 13, 17, 11])==[5, 17]
output: def min_max(arr):
    if not arr:
      return []
    min_val = min(arr)
    max_val = max(arr)
    return [min_val, max_val]