Skip to content

Commit 2dbe5fe

Browse files
committed
Create 1189-Maximum-Number-of-Balloons.py
1 parent 517b2e5 commit 2dbe5fe

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from collections import Counter
2+
3+
4+
class Solution:
5+
def maxNumberOfBalloons(self, text: str) -> int:
6+
count = Counter(text)
7+
return min(count["b"], count["a"], count["l"] >> 1, count["o"] >> 1, count["n"])

0 commit comments

Comments
 (0)