Code Room
CodingMediumcod-g1211
Subject Data wranglingLevel Entry–Mid~14 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

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"].

Implement
rank_players(rows: list[str]) → list[str]
Examples
in[["kim,30","ali,42","joe,30"]]out["ali,42","joe,30","kim,30"]
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.