Pregunta de entrevista de Amdocs

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