static private string[] array = { "aa", "bb","ee", "cc","abc","abc"};
public static bool foo(string[] arr, int index)
{
if (arr == null && arr.Length == 0) {
return false;
}
if (IsRepeat(arr, index))
{
return true;
}
else
{
return IsRepeat(arr, index + 1);
}
}
public static bool IsRepeat(string[] arr, int index)
{
int count = 0;
for (int i = 0; i < arr.Length; i++)
{
if (arr[index] == arr[i])
{
count++;
}
if (count > 1)
{
return true;
}
}
return false;
}
static void Main(string[] args)
{
Console.WriteLine(foo(array, 0));
}