No. of occurences of every element in an array