Crown the Top Performer

Intermediate

A scoreboard maps each rep to their sales total. The banner needs the name of the single highest scorer. Ties go to whichever key the map yields first.

Implement `solve(Map<String,Integer> scores)` (non-empty) to return the key with the highest value.

Examples

Input{alice=90, bob=85, cara=95}
Output"cara"
Input{solo=1}
Output"solo"
Hints
  • Track the best key and best value while iterating keySet().
Anonymous Apex

Your code runs in a secure sandbox against multiple hidden test cases. The problem is solved only when every test passes. Each run is isolated and any data changes are rolled back automatically.