//Write a program in C# Sharp to count a total number of duplicate elements in an array.
            Console.WriteLine("Enter first length");
            int firstlength=int.Parse(Console.ReadLine());
            int[] firstarray = new int[firstlength];
            int k=0;
            Console.WriteLine("Enter second length");
            int secondlength = int.Parse(Console.ReadLine());
            int[] secondarray = new int[secondlength];
            int i, j;
            for (i = 0; i < firstarray.Length; i++)
            {
                firstarray[i] = int.Parse(Console.ReadLine());
            }
            i = 0;
            for (j  = 0; j < secondarray.Length; j++)
            {
               
                secondarray[j] = firstarray[i];
                i++;
                Console.WriteLine(secondarray[j]);
            }
            for (i = 0; i < firstarray.Length; i++)
            {
                for (j = 0; j < secondarray.Length; j++)
                {
                    if (firstarray[i] == secondarray[j])
                    {
                        k++;
                        
                    }
                   
                    
                }
                k = 1;
            }
 
Struck here pls help