Given two strings A and B, check if they are anagrams.
Two strings are said to be anagrams, if one string can be obtained by rearranging the letters of another.
Examples of anagrams are dog, god; abac, baac; 123, 312
abab, aaba; dab, baad are not anagrams.
INPUT :
First line of the input is the number of test cases T. It is followed by T lines, each line has two space separated strings A and B;
OUTPUT For each test case, print "YES" if they are anagrams, otherwise print "NO". (without quotes)
Constraints 1 <= T <= 10 A and B both contain only lower case latin letters 'a' to 'z' and digits 0 to 9. Length of each string A and B does not exceed 5*10^5 (500000),
Input shall be taken in a textarea and output printed in a div.
Aucun commentaire:
Enregistrer un commentaire