cswork / OA打开练习工作台

QuoraOA #2

Determine the Elimination Order (MLE)

估计简单评测数据准备中,可先阅读题面

考点(AI 标注)模拟/实现字符串哈希计数

Given the competition results, determine the elimination order. For example: Input: [["Tom 20", "Sam 10"], ["Sam 20", "Tom 10"]] In the first round, Tom takes the longest time and gets eliminated. In the second round, only Sam remains, so their score is valid and added to the output list. Output: ["Tom", "Sam"] Edge case: If scores are tied, all tied contestants are eliminated simultaneously.

Example 1

Input:

results = [["Tom 20", "Sam 10"], ["Sam 20", "Tom 10"]]

Output:

["Tom", "Sam"]

Explanation: In the first round, Tom takes the longest time and gets eliminated. In the second round, only Sam remains, so their score is valid and added to the output list.