题目要求: https://leetcode-cn.com/problems/maximum-number-of-balloons/
class Solution:
def maxNumberOfBalloons(self
, text
: str) -> int:
d
= collections
.Counter
(text
)
return min(d
['b'], d
['a'], d
['l'] // 2, d
['o'] // 2, d
['n'])
转载请注明原文地址: https://mac.8miu.com/read-502928.html