Amazon interview question

Question on array and frequency of elements