Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4657086

Browse files
Merge pull request vJechsmayr#461 from ralph44/1189---Maximum-Number-of-Ballons
1189 - Maximum Number of Ballons
2 parents 3c33585 + 40ed8cb commit 4657086

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Solution(object):
2+
def maxNumberOfBalloons(self, text) -> int:
3+
"""
4+
:type text: str
5+
:rtype: int
6+
"""
7+
a_count = text.count("b")
8+
b_count = text.count("a")
9+
l_count = text.count("l") / 2
10+
o_count = text.count("o") / 2
11+
n_count = text.count("n")
12+
return int(min([a_count,b_count,l_count,o_count,n_count]))

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /