怎么只营10%
懒的研究了
一生就只赢10%了
def commonChars(self, words: List[str]) -> List[str]:
n = len(words)
cnt = [2**32-1 for _ in range(26)]
# cnt
for i in range(n):
cnt_cur = [0 for _ in range(26)]
for c in words[i]:
cnt_cur[ord(c)-ord('a')]+=1
for i in range(26):
cnt[i] = min(cnt[i], cnt_cur[i])
ans = []
for i in range(26):
for j in range(cnt[i]):
ans.append(chr(ord('a')+i))
return ans