using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PelindromeIdentifier
{
class Program
{
static void Main()
{
int nNumberOfTestCases = 0;
int.TryParse(Console.ReadLine(), out nNumberOfTestCases);
String[] strTestCases = new String[nNumberOfTestCases];
char[] arrChar;
int nCharCount = 0;
bool bAllow = false;
int nCharIndex = 0;
for (int nTestCase = 0; nTestCase < nNumberOfTestCases; nTestCase++)
{
strTestCases[nTestCase] = Console.ReadLine();
}
for (int nTestCase = 0; nTestCase < nNumberOfTestCases; nTestCase++)
{
bAllow = false;
arrChar = strTestCases[nTestCase].Distinct().ToArray();
for (nCharIndex = 0; nCharIndex < arrChar.Length; nCharIndex++)
{
nCharCount = strTestCases[nTestCase].Count(i => i.Equals(arrChar[nCharIndex]));
if (strTestCases[nTestCase].Length % 2 == 0)
{
if (nCharCount % 2 != 0)
{
Console.WriteLine("NO");
break;
}
}
else
{
if (nCharCount % 2 != 0)
{
if (bAllow == true)
{
Console.WriteLine("NO");
break;
}
bAllow = true;
}
}
}
if (nCharIndex == arrChar.Length)
{`
Console.WriteLine("YES");
}
}
}
}
}
I tried this but there are some hidden test cases which are not working.Can anybody help me?In this program the program will ask user how many times you want to take input string and for every string it will return whether the string is palindrome or not