input: Write a function to find the minimum and maximum values in an array and return them as a list. If the array is empty, return an empty list.
  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([5])==[5, 5]
  assert min_max([10, 10, 10])==[10, 10]
  assert min_max([])==[]
output: def min_max(arr):
    if not arr:
      return []
    min_val = min(arr)
    max_val = max(arr)
    return [min_val, max_val]