Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```
- from collections import Counter
- class Solution(object):
- def maxNumberOfBalloons(self, text):
- """
- :type text: str
- :rtype: int
- """
- ballon_counter = Counter("balloon")
- text_counter = Counter(text)
- min_count = float("inf")
- for letter, count_needed in ballon_counter.items():
- min_count = min(min_count, text_counter[letter]/count_needed)
- return min_count
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement