1189. Maximum Number of Balloons Easy
1/**
2 * [1189] Maximum Number of Balloons
3 *
4 * Given a string text, you want to use the characters of text to form as many instances of the word "balloon" as possible.
5 * You can use each character in text at most once. Return the maximum number of instances that can be formed.
6 *
7 * Example 1:
8 * <img alt="" src="https://assets.leetcode.com/uploads/2019/09/05/1536_ex1_upd.JPG" style="width: 132px; height: 35px;" />
9 *
10 * Input: text = "nlaebolko"
11 * Output: 1
12 *
13 * Example 2:
14 * <img alt="" src="https://assets.leetcode.com/uploads/2019/09/05/1536_ex2_upd.JPG" style="width: 267px; height: 35px;" />
15 *
16 * Input: text = "loonbalxballpoon"
17 * Output: 2
18 *
19 * Example 3:
20 *
21 * Input: text = "leetcode"
22 * Output: 0
23 *
24 *
25 * Constraints:
26 *
27 * 1 <= text.length <= 10^4
28 * text consists of lower case English letters only.
29 *
30 */
31pub struct Solution {}
32
33// problem: https://leetcode.com/problems/maximum-number-of-balloons/
34// discuss: https://leetcode.com/problems/maximum-number-of-balloons/discuss/?currentPage=1&orderBy=most_votes&query=
35
36// submission codes start here
37
38impl Solution {
39 pub fn max_number_of_balloons(text: String) -> i32 {
40 0
41 }
42}
43
44// submission codes end
45
46#[cfg(test)]
47mod tests {
48 use super::*;
49
50 #[test]
51 fn test_1189() {
52 }
53}
54
Back
© 2025 bowen.ge All Rights Reserved.