原题链接:https://leetcode-cn.com/problems/maximum-number-of-balloons/
class Solution {
public:
int maxNumberOfBalloons(string text) {
unordered_map<char ,int> mp;
string s = "balloon";
for (auto x : s) mp[x] = 0;
for (auto x : text) {
if (mp.count(x)) mp[x]++;
}
int res = INT_MAX;
for (auto x : mp) {
int k = x.first, v = x.second;
if (k == 'l' || k == 'o') v /= 2;
res = min(v, res);
}
return res;
}
};