diff --git a/LeetCode/1189_Maximum_Number_of_Balloons.py b/LeetCode/1189_Maximum_Number_of_Balloons.py new file mode 100644 index 0000000..805eaf3 --- /dev/null +++ b/LeetCode/1189_Maximum_Number_of_Balloons.py @@ -0,0 +1,12 @@ +class Solution(object): + def maxNumberOfBalloons(self, text) -> int: + """ + :type text: str + :rtype: int + """ + a_count = text.count("b") + b_count = text.count("a") + l_count = text.count("l") / 2 + o_count = text.count("o") / 2 + n_count = text.count("n") + return int(min([a_count,b_count,l_count,o_count,n_count])) \ No newline at end of file