Код: Выделить всё
targets = ["cat","bt","hat","tree"], chars = "atach"
< /code>
Мой код следующим образом: < /p>
ans = 0
chars_freq = Counter(chars)
for word in targets:
word_freq = Counter(word)
for char in word:
if word_freq[char] > chars_freq[char]:
break
ans += 1
return ans
Подробнее здесь: https://stackoverflow.com/questions/795 ... -in-python