Given an arry A (may contain duplicates) of N elements and a positive integer K. The task is to count the number of elements which occurs exactly floor(N/K) times in the array.
Hint: You may use hashing or brute-force.
First line of input contains number of testcases. For each testcase, there will be two lines, first of which contains N and K and second line contains array elements.
For each testcase, print the count of elements in the array which occurs exactly floor(N/K) times.
1 <= T <= 100
1 <= N <= 103
1 <= Ai <= 103
Your task is to complete the function countSpecials() which should count the elements which occurs exactly floor(N/K) times.
1 4 1 2 4
Testcase 1: In the given array, 1 and 4 occurs floor(5/2) = 2 times. So count is 2.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.