Breaking the Lock
All submissions for this problem are available.
Jahar, the villain of Arab is planning an attack to usurp the Sultans’s throne. The Sultan learns of this conspiracy from Genie and plans to lock the single door through which the enemy can enter his kingdom.
But, to lock the door he needs a key that is an anagram of a certain palindrome string.
The Sultan has a string composed of lowercase English letters. Help him figure out whether any anagram of the string can be a palindrome or not.
The first line contains a single integer T denoting the number of test cases.
For each test case, input a single line which contains the input string.
1<=length of string<= 105
each character of the string is a lowercase English letter.
For each test case output a single line which contains YES or NO in uppercase.
Sample Input : 01 aaabbbb Sample Output : 01 YES Sample Input : 02 cdefghmnopqrstuvw Sample Output : 02 NO
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
Fetching successful submissions
If you are still having problems, see a sample solution here.