from collections import Counter
class Solution:
def shortestCompletingWord(self, licensePlate: str, words: List[str]) -> str:
# 仅保留字母并将其统一转换为小写字母
cnt = Counter(ch.lower() for ch in licensePlate if ch.isalpha())
# word中完全包含licensePlate中的字母,那么即为最短补全词(根据word长度正序排列)
return min((word for word in words if not cnt - Counter(word)),key=len)
12-10
2635
09-19