A game keeps one record per player as a tuple (name, score, attempts). Return the list of player names in leaderboard order:
- higher
scorefirst, - among equal scores, fewer
attemptsfirst, - among equal scores and attempts,
namein ascending alphabetical order.
Examples
Input: players = [("ana", 90, 3), ("bo", 95, 5), ("cy", 90, 2), ("di", 95, 5)]
Output: ["bo", "di", "cy", "ana"]
Explanation: bo and di both have 95 points with 5 attempts, so they are ordered by name.
cy beats ana because both have 90 points but cy needed fewer attempts.
Constraints
0 <= len(players) <= 10**5- Names are non-empty lowercase strings; scores and attempts are non-negative integers.
- Target complexity: O(n log n).
Goals
- Build a sort key that mixes descending and ascending fields
- Use negation to flip the direction of a numeric field
- Extract one field from sorted records