#C436. Permutation Checker: Are Two Strings Permutations?

    ID: 47889 Type: Default 1000ms 256MiB

Permutation Checker: Are Two Strings Permutations?

Permutation Checker: Are Two Strings Permutations?

Given two strings, determine whether they are permutations of each other. Two strings are considered permutations if they consist of the exact same characters, though possibly arranged in a different order.

You will be given multiple test cases. For each test case, check if the two provided strings are permutations of one another.

Recall that two strings \( s_1 \) and \( s_2 \) are permutations if \( sorted(s_1) = sorted(s_2) \).

inputFormat

The first line of the input contains an integer \( T \) (\( T \ge 1 \)) denoting the number of test cases.

Each of the following \( T \) lines contains two non-empty strings separated by a space. The strings consist of lowercase letters only.

outputFormat

For each test case, output a single line containing YES if the two strings are permutations of each other, otherwise output NO.

## sample
5
abc bca
abc def
aabbcc abcabc
abcd abc
abcd abcc
YES

NO YES NO NO

</p>