Accept an Array of size N and print the total number of duplicate elements (The elements which occur two or more times).
Input Format: The first line contains N. The second line contains the N positive integer values, each separated by a space.
Output Format: The first line contains the count of duplicate elements.
The program I wrote works for only two same elements and fails to read more than 2 duplicates.