Want to get involved? We're always looking for ideas and content for Weekly Challenges.
SUBMIT YOUR IDEAMy solution.
Fun challenge!
Other than basic steps, I also added a few steps to ensure racers who didn't finish all laps don't get points. 🙂
According to wikipedia there is a scoring wrinkle: "To receive points a racer need not finish the race, but at least 90% of the winner's race distance must be completed". As close as I can tell the provided solution does not cover that eventuality, although admittedly given this data set it does not change the result 🙂
Wish I had done this one right away but I finally found some time at the end of today. Great challenge for those getting started or doing core prep. Get's you thinking about data and ranking. Solution attached with flow spoiler image below.
My solution is a bit over-complicated, because I wanted to attempt to handle ties, and figure out what to do if <10 drivers finish the race. In this particular dataset there were no ties, so it doesn't affect the result.
I found this:
"Points are awarded to drivers and teams based on their finishing order. The winner receives 25 points, the second place finisher 18 points, with 15, 12, 10, 8, 6, 4, 2 and 1 points for positions 3 through 10. If a race is stopped before 75% of the scheduled race distance has been completed, the points awarded are cut in half. If two or more drivers tie for a position, prizes and points are added together and shared equally for all those drivers who tie. Constructors receive points as well as drivers. Each constructor receives the same amount of points that their two drivers earned."
Since we aren't given the total number of laps for each race, I didn't check for the 75% completed rule.
Really cool challenge for a F1 fan. I am looking forward for the first GP of the 2020 season! Would love to have more sport examples.