Result: Accepted
Time: 1ms
Memory: 1092kB
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char sb[101];
int a[26] = {0}, b[26] = {0}, i, j, t;
char ch;
scanf("%d%*c", &t);
while(t--)
{
memset(a, 0, sizeof(a));
memset(b, 0, sizeof(b));
while (scanf("%c", &ch), ch != '\n')
{
if (ch != ' ')
{
a[ch - 97]++;
}
}
while (scanf("%c", &ch) != -1 && ch != '\n')
{
if (ch != ' ')
{
b[ch - 97]++;
}
}
j = 1;
for (i = 0; i < 26; i++)
{
if (a[i] != b[i])
{
j = 0;
break;
}
}
if (j)
{
printf("Yes\n");
}
else
{
printf("No\n");
}
}
}