Dsa
Arrays
Warm-up
Count Unique Modes
You are given an array of integers. Your task is to find how many unique modes exist in the array. The mode is the number that appears most frequently in the array. If there are ties, count each mode as unique. Please note that the input array can contain negative numbers and zeros.
Input format:
- A single line containing space-separated integers.
Output format:
- A single integer representing the count of unique modes.
Example:
Input:
1 2 3 3 4 4 4 5 5
Output:
2
Key concepts
arrayscountingstatistics
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