input: 
  def min_max(arr):
      """
      Finds the greatest and smallest values in the given array and returns them as a list.
      >>> min_max([3, 4, 2, 8, 15, 6])
      [2, 15]
      >>> min_max([7, -1, 8, 12, 5])
      [-1, 12]
      """
      min_val = min(arr)
      max_val = max(arr)
      return [min_val, max_val]
  
output:     min_val = min(arr)
      max_val = max(arr)
      return [min_val, max_val]