1189. Maximum Number of Balloons

Обновлено: 2024-03-12
1 мин
[]

Содержание

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')