#C9562. Anagram Checker
Anagram Checker
Anagram Checker
Given two strings, determine whether they are anagrams of each other. Two strings are anagrams if they contain the exact same characters, but possibly in a different order. The comparison is case-sensitive.
For each test case, if the two strings are anagrams, output YES
. Otherwise, output NO
.
Note: The input is provided via standard input and the output should be printed to standard output.
inputFormat
The first line of input contains a single integer T (1 ≤ T ≤ 1000) representing the number of test cases. Each of the next T lines contains two space-separated strings. Each string consists of only lowercase and uppercase English letters.
outputFormat
For each test case, output a single line containing YES
if the two strings are anagrams of each other, otherwise output NO
.
3
aabbcc aabbcc
abc cba
abcd abce
YES
YES
NO
</p>