input: Write a function to return an array containing the greatest and smallest values from the given array of numbers.
  
  def min_max(arr):
    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, 3, 44, 2]) == [2, 44]
  assert min_max([]) == []
  assert min_max([5]) == [5, 5]
output: def min_max(arr):
    if not arr:
      return []
    min_val = min(arr)
    max_val = max(arr)
    return [min_val, max_val]