Console.Write("Input the number of elements to be stored in the array: ");
int n = int.Parse(Console.ReadLine());
for (int i = 0; i < n; i++)
Console.Write($"Element {i} : ");
arr[i] = int.Parse(Console.ReadLine());
for (int i = 0; i < n; i++)
for (int j = i + 1; j < n; j++)
if (count > 1 && arr[i] != -1)
Console.WriteLine($"Element {arr[i]} occurred {count} times");
Console.WriteLine($"Total number of duplicate elements found in the array is: {totalDuplicates}");