0 to carsCount - 1) running lapsCount laps (IDs 0 to lapsCount - 1).
At the end of each lap, a car reports how much time it took to complete that lap. You must maintain:
carId and lapId will always be valid.timeTaken will always be a positive integer.(carId, lapId) is recorded at most once.timeTaken.carId-lapId-timeTakentimeTaken is the same:
carId firstlapId firsttotalTime / lapsRecorded (use a precise average, not integer division). carId firstAssume carsCount = 4, lapsCount = 3.
recordLapTiming(1, 0, 70)
recordLapTiming(2, 0, 69)
getTop3FastestLaps() -> ["2-0-69", "1-0-70"]
getTop3Drivers() -> [2, 1]
// continue from Example 1
recordLapTiming(3, 0, 69)
getTop3FastestLaps() -> ["2-0-69", "3-0-69", "1-0-70"]
getTop3Drivers() -> [2, 3, 1]
// more laps
recordLapTiming(2, 1, 71) // car2 avg = (69+71)/2 = 70.0
recordLapTiming(3, 1, 65) // car3 avg = (69+65)/2 = 67.0
recordLapTiming(1, 1, 66) // car1 avg = (70+66)/2 = 68.0
getTop3FastestLaps() -> ["3-1-65", "1-1-66", "2-0-69"]
getTop3Drivers() -> [3, 1, 2]