Dsa
Arrays
Easy
Unique Element Counter
Write a program that counts the number of unique elements in an integer array. The unique elements are those that appear exactly once. The input will be given in the following format:
- The first line will contain n (1 <= n <= 1000).
- The second line will contain n integers, which are the elements of the array.
Output a single integer representing the count of unique elements.
Example:
Input:
6
1 2 3 2 1 4
Output:
1
Key concepts
arrayscountinghashing
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now