Advent of Code, Day 4: forecast fudging
The weather forecast is often wrong. Sometimes embarrassingly so. I always laugh when I look at the weather on my phone and it says "High of 54°, Low of 35°, currently 28°". Like, couldn't they update the Low-temp to be at least as low as the
Well, one station has decided to do something about it. Not something as hard as fixing their algorithm, oh no no no. They're going to change their recorded forecast to make it look like they were right
Help the station choose which five numbers of their November forecast to change. Choose the predictions that were the farthest from what actually happened, but be careful! Don't change more than one number on the same day. Someone would
- If the station predicted a low of 35° and it only got as low as 38°, they're not embarrased by that.
- Similiarly, if the station predicted a high of 56° and the real temperature never got that high, they aren't worried about that.
- If the station predicted 37° and the actual low was 30°, that's a candidate for removal.
- Given two discrepancies, the one with a greater number of degrees is the more embarrasing one.
The input data is a csv with the following headers:
day_in_month, predicted_low, predicted_high, actual_low, actual_high
The output data should be five lines, sorted by day_in_month:
<day_in_month> <high_or_low> <new_val>
So if you wanted to advise changing the high to 45° on the 4th, as well as the low to 23° on the 8th (and three other changes), you would submit:
4 high 45 8 low 23 ...
When you're ready, download fudging_forecasts_nov.csv and submit your advice.