#include <iostream>
#include <string>
#include <map>
using namespace std;
int main()
{
map <char, int> mp;
string store, cus;
int a = 0; //a表示缺少的
cin >> store >> cus;
for(int i = 0; i < store.length(); i ++)
{
mp[store[i]] ++;//可以理解为统计库存(*^▽^*)
}
for(int i = 0; i < cus.length(); i ++)
{
if(mp[cus[i]] > 0) mp[cus[i]] --;//模拟小红买珠子(将库存和顾客的需求相比较)
else a ++;
}
if(a > 0) cout << "No" << " " << a << endl;
else cout << "Yes" << " " << store.length() - cus.length() << endl;
return 0;
}
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交