β back to unit
Medium
# breaking it down medium
The Race Gap Report
The commentators want the gap-to-winner for every racer, in starting order. π
You get the racers' names and their finish times (matching lists). Print one line per racer, in the given order: <name> <gap> where the gap is their time minus the winner's time (the winner shows 0).
Example:
Input: names = ["mia", "leo", "kai"], times = [62, 58, 71]
Output:
mia 4
leo 0
kai 13
leo's 58 is the winning time. mia's gap is 62 - 58 = 4, leo's is 0, and kai's is 71 - 58 = 13.
π‘ need a hint?
brk-race-gaps.pyπ given lines are locked β write your code in between
loading...