1189. Maximum Number of Balloons

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1189

class Solution:
    def maxNumberOfBalloons(self, text: str) -> int:
        cnt = Counter(text)
        cnt['o'] >>= 1
        cnt['l'] >>= 1
        return min(cnt[c] for c in 'balon')