Function mostFrequent

Finds most frequent value in array