Amdocs Interview Question

How will you count occurrences of every element in an array?