Ankush challenges Ankit to complete his code which implements the functionality of checking if the first and last name of a student is an anagram of each other or not.
An anagram of a string is another string that contains same characters, only the order of characters can be different. For example, “act” and “tac” are anagram of each other. Invest your time to study the locked code and complete it accordingly.
The first line contains the number of test cases, each test case consists of one line input containing 2 space separated strings representing the first and last name of the student.
For each test case T, the output should consist of a single line - ANAGRAM or NOT ANAGRAM depending upon if the 2 given strings are anagram of each other or not.
1 <= T <= 100
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?Yes