1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-02-04 14:40:27 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/“气球” 的最大数量 [maximum-number-of-balloons].html

44 lines
1.5 KiB
HTML
Raw Normal View History

2025-01-09 20:29:41 +08:00
<p>给你一个字符串&nbsp;<code>text</code>,你需要使用 <code>text</code> 中的字母来拼凑尽可能多的单词&nbsp;<strong>"balloon"(气球)</strong></p>
2022-03-27 20:37:52 +08:00
2025-01-09 20:29:41 +08:00
<p>字符串&nbsp;<code>text</code> 中的每个字母最多只能被使用一次。请你返回最多可以拼凑出多少个单词&nbsp;<strong>"balloon"</strong></p>
2022-03-27 20:37:52 +08:00
<p>&nbsp;</p>
2025-01-09 20:29:41 +08:00
<p><strong class="example">示例 1</strong></p>
2022-03-27 20:37:52 +08:00
2025-01-09 20:29:41 +08:00
<p><strong><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2019/09/14/1536_ex1_upd.jpeg" style="height: 35px; width: 154px;" /></strong></p>
2022-03-27 20:37:52 +08:00
2025-01-09 20:29:41 +08:00
<pre>
<strong>输入:</strong>text = "nlaebolko"
2022-03-27 20:37:52 +08:00
<strong>输出:</strong>1
</pre>
2025-01-09 20:29:41 +08:00
<p><strong class="example">示例 2</strong></p>
2022-03-27 20:37:52 +08:00
2025-01-09 20:29:41 +08:00
<p><strong><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2019/09/14/1536_ex2_upd.jpeg" style="height: 35px; width: 233px;" /></strong></p>
2022-03-27 20:37:52 +08:00
2025-01-09 20:29:41 +08:00
<pre>
<strong>输入:</strong>text = "loonbalxballpoon"
2022-03-27 20:37:52 +08:00
<strong>输出:</strong>2
</pre>
2025-01-09 20:29:41 +08:00
<p><strong class="example">示例 3</strong></p>
2022-03-27 20:37:52 +08:00
2025-01-09 20:29:41 +08:00
<pre>
<strong>输入:</strong>text = "leetcode"
2022-03-27 20:37:52 +08:00
<strong>输出:</strong>0
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
2025-01-09 20:29:41 +08:00
<li><code>1 &lt;= text.length &lt;= 10<sup>4</sup></code></li>
2022-03-27 20:37:52 +08:00
<li><code>text</code>&nbsp;全部由小写英文字母组成</li>
</ul>
2025-01-09 20:29:41 +08:00
<p>&nbsp;</p>
<p><strong>注意:</strong>本题与&nbsp;<a href="https://leetcode.cn/problems/rearrange-characters-to-make-target-string/">2287. 重排字符形成目标字符串</a>&nbsp;相同。</p>