文章
112
粉丝
69
获赞
218
访问
69.3k
#include<bits/stdc++.h>
using namespace std;
int n;
unordered_map<char, int> h;
bool check(string a, string b)
{
for(int i = 0; i < a.size(); i ++) h[a[i]] ++;
for(int i = 0; i < b.size(); i ++) h[b[i]] --;
for(auto v : h)
if(v.second < 0) return false;
return true;
}
int main()
{
cin >> n;
while(n --)
{
string s1, s2;
h.clear();
cin >> s1 >> s2;
if(s1 == s2 ||check(s1, s2)) cout << "Yes" << endl;
else cout << "No" << endl;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发