Problem library

MVP Vote

Easy
hash mapcounting

After a tournament, every player votes for an MVP. You get the list of names voted for.

Return the name with the most votes. If several names tie, return the one that comes first alphabetically. The list always has at least one vote.

Examples

Input: votes = ["kai","ivy","kai"]
Output: "kai"
Input: votes = ["zed","amy"]
Output: "amy"