Rank players by points

Write codeMedium14 min

Your task

A basketball league stores one player per row as "name,points", where points is a non-negative integer and names are distinct. Return the rows reordered for the standings page: highest points first, and when two players are tied on points, alphabetical by name. Example: ["kim,30", "ali,42", "joe,30"] gives ["ali,42", "joe,30", "kim,30"].

Examples

rank_players(rows: list[str]) -> list[str]
Example 1
Inputrank_players(["kim,30", "ali,42", "joe,30"])
Output["ali,42", "joe,30", "kim,30"]