It's a kind of application of count sort. Every element of the array is less than or equal to n (i.e. the elements lie in some given range).
We just need first part of the count sort which counts the occurrences of each element.
A[ ] is the input array, count[ ] keeps track of the number of times each element of A[] occurs
for i=1 to A.length
{ count[A[i]]= count[A[i]] + 1 }
This loop takes O(n) time.
After this we need one more O(n) scan of count[ ] to check if any entry is more than n/2.
Total time complexity= O(n) + O(n)= O(n). So, answer is (b).