input: Write a function to determine the list of words that appear at least n times in a given list of words. If the input list is empty, return an empty list.
  assert frequent_words(['a', 'b', 'a', 'c', 'd', 'a', 'x', 'd', 'd'], 3) == ['a', 'd']
  assert frequent_words(['apple', 'banana', 'apple', 'cherry'], 2) == ['apple']
  assert frequent_words(['hello', 'world'], 1) == ['hello', 'world']
  assert frequent_words([], 3) == []
  assert frequent_words(['a', 'b', 'c', 'd'], 5) == []
output: def frequent_words(words, n):
      if not words:
          return []
      word_count = {}
      for word in words:
          if word in word_count:
              word_count[word] += 1
          else:
              word_count[word] = 1
      result = [word for word, count in word_count.items() if count >= n]
      return result