input: 
  def find_mode(values: List[int]) -> int:
      """ Finds the mode of the given set of values. The mode is the value that 
      appears most frequently in the set. If there are multiple modes, the function
      will return the first one encountered in the list.
      >>> find_mode([1, 2, 3, 2, 4, 2])
      2
      >>> find_mode([5, 5, 5, 2, 2, 2, 9, 9])
      5
      """
  
output:     frequency = {}
      for value in values:
          if value in frequency:
              frequency[value] += 1
          else:
              frequency[value] = 1
      
      max_count = 0
      mode = None
      for value, count in frequency.items():
          if count > max_count:
              max_count = count
              mode = value
      
      return mode