cswork / OA打开练习工作台

DatabricksOA #8

Stock Car Race Elimination

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

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

All the competitors in a stock car race have completed their qualifying laps. Each lap, the driver with the current slowest "best" time is eliminated (that is, the highest personal best time). If multiple drivers tie for the slowest time, they are all eliminated.

You are given a two-dimensional string array with each driver's name and lap time in seconds for each lap. Your task is to return the drivers in the order in which they were eliminated, ending with the last driver or drivers remaining. When multiple drivers are eliminated on the same lap, their names should be listed alphabetically.

Example: laps = [["Harold 154","Gina 155","Juan 160"],["Juan 152","Gina 153","Harold 148"],["Harold 148","Gina 150","Juan 149"]] returns ["Juan","Harold","Gina"].