input: 
  from typing import List
  
  def min_max(arr: List[int]) -> List[int]:
      """ Finds the greatest and smallest values in the given array of numbers.
      >>> min_max([3, 4, 2, 8, 15, 6])
      [2, 15]
      """
  
output:     if not arr:
          return []
      min_val = arr[0]
      max_val = arr[0]
      for num in arr:
          if num < min_val:
              min_val = num
          if num > max_val:
              max_val = num
      return [min_val, max_val]