def find_word(lst: list[str], n: int) -> str:
for word in set(lst):
if lst.count(word) == n:
return word
return ""
# 示例
words = ["apple", "banana", "apple", "pear", "peach", "peach"]
n = 2
result = find_word(words, n)
print(result) # 输出 "apple"