Count votes in a map; among maximal counts take the lexicographically smallest name.
Complexity: O(N)