|
1 | 1 | packagecom.fishercoder.solutions; |
2 | 2 |
|
3 | | -/** |
4 | | - * 1189. Maximum Number of Balloons |
5 | | - * |
6 | | - * Given a string text, you want to use the characters of text to form as many instances of the word "balloon" as possible. |
7 | | - * You can use each character in text at most once. Return the maximum number of instances that can be formed. |
8 | | - * |
9 | | - * Example 1: |
10 | | - * Input: text = "nlaebolko" |
11 | | - * Output: 1 |
12 | | - * |
13 | | - * Example 2: |
14 | | - * Input: text = "loonbalxballpoon" |
15 | | - * Output: 2 |
16 | | - * |
17 | | - * Example 3: |
18 | | - * Input: text = "leetcode" |
19 | | - * Output: 0 |
20 | | - * |
21 | | - * Constraints: |
22 | | - * 1 <= text.length <= 10^4 |
23 | | - * text consists of lower case English letters only. |
24 | | - * */ |
25 | 3 | publicclass_1189 { |
26 | 4 | publicstaticclassSolution1 { |
27 | 5 | publicintmaxNumberOfBalloons(Stringtext) { |
|