Majority Element

http://rosalind.info/problems/maj/

Given: A positive integer k≤20, a positive integer n≤104, and k arrays of size n containing positive integers not exceeding 105.

Return: For each array, output an element of this array occurring strictly more than n/2 times if such element exists, and "-1" otherwise.