Day 7
Today was super easy!
This was a fun, speed coding challenge - I'm just about holding second place on the school leaderboard though! I had a timeout for p1 because I asked for the max and not the min (losing about 20 seconds).
For Part 1, it was just going through a load of numbers (1000 in this case, which I estimated from a quick glance at the input) and determining the overall value for each one, then selecting the shortest. I also formatted the data into a list of integers. A simple list comprehension with a for loop was plenty. abs() gets the absolute value of a number (essentially the difference betwen two numbers when you subtract one from another in the abs())
Part 2 was a similar idea, just that we needed to use triangle numbers to find the distance (n)(n+1) / 2 to account for the increased value. Another option would be a for loop if you didn't spot this pattern, and just continuously adding an aditional one to the distance.
Now to revise for my biology mock...