MostFrequentElement

from the homework for arrays