Pergunta de entrevista da empresa AppTcom

What's the fastest way to get the number of duplication items in this array? (algorithms / pseudo code)