Solution 1 - Min Frequency Intersection
Take per-character minimum count across all words.
""" 1002.1 - Find Common Characters - Solution 1 - Min Frequency Intersection """
from collections import Counter
from typing import List
class Solution:
def commonChars(self, words: List[str]) -> List[str]:
c = Counter(words[0])
for w in words[1:]:
c &= Counter(w)
return list(c.elements())