-
Notifications
You must be signed in to change notification settings - Fork 160
/
Copy pathmaximum-number-of-balloons.md
37 lines (26 loc) · 1.25 KB
/
maximum-number-of-balloons.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<p>Given a string <code>text</code>, you want to use the characters of <code>text</code> to form as many instances of the word <strong>"balloon"</strong> as possible.</p>
<p>You can use each character in <code>text</code> <strong>at most once</strong>. Return the maximum number of instances that can be formed.</p>
<p> </p>
<p><strong>Example 1:</strong></p>
<p><strong><img alt="" src="https://assets.leetcode.com/uploads/2019/09/05/1536_ex1_upd.JPG" style="width: 132px; height: 35px;" /></strong></p>
<pre>
<strong>Input:</strong> text = "nlaebolko"
<strong>Output:</strong> 1
</pre>
<p><strong>Example 2:</strong></p>
<p><strong><img alt="" src="https://assets.leetcode.com/uploads/2019/09/05/1536_ex2_upd.JPG" style="width: 267px; height: 35px;" /></strong></p>
<pre>
<strong>Input:</strong> text = "loonbalxballpoon"
<strong>Output:</strong> 2
</pre>
<p><strong>Example 3:</strong></p>
<pre>
<strong>Input:</strong> text = "leetcode"
<strong>Output:</strong> 0
</pre>
<p> </p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>1 <= text.length <= 10^4</code></li>
<li><code>text</code> consists of lower case English letters only.</li>
</ul>