Back to O(logn) time and O(n) memory
1-when a player logs in,insert both his {level,id} into set
2-when the player logout,erase both his {level,id} from the set
now you have best players Added in the list,just iterate in the following way
two variables highestLevelFound = 0,timesFound = 0;
once...