private int[] ReturnduplicateElement(int[] a1)
{
Hashtable objHashTable = new Hashtable();
List<int> integerList = new List<int>();
for (int i = 0; i < a1.Length ; i++)
{
if (objHashTable.ContainsKey(a1[i]))
{
integerList.Add(a1[i]);
}
else{ objHashTable.Add(a1[i], a1[i]); }
}
return integerList.ToArray();
}In an array 1-100 many numbers are duplicates, how do you find it?
