Skip to content

Latest commit

 

History

History

Two_Strings

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Two Strings

**Given two strings of equal length, you have to tell whether they both strings are identical.


Two strings S1 and S2 are said to be identical, if any of the permutation of string S1 is equal to the string S2. See Sample explanation for more details.**

Input Format
First line, contains an intger 'T' denoting no. of test cases.
Each test consists of a single line, containing two space separated strings S1 and S2 of equal length.

Output Format
For each test case, if any of the permutation of string S1 is equal to the string S2 print YES else print NO.

Constraints
1<= T <=100
1<= |S1| = |S2| <= 10^5
String is made up of lower case letters only.

Sample Input
3
sumit mitsu
ambuj jumba
abhi hibb

Sample Output
YES
YES
NO