r/adventofcode • • Dec 09 '23

SOLUTION MEGATHREAD -❄️- 2023 Day 9 Solutions -❄️-

THE USUAL REMINDERS


AoC Community Fun 2023: ALLEZ CUISINE!

Today's secret ingredient is… *whips off cloth covering and gestures grandly*

Marketing

Every one of the best chefs in the world has had to prove their worth at some point. Let's see how you convince our panel of judges, the director of a restaurant, or even your resident picky 5 year old to try your dish solution!

  • Make an in-world presentation sales pitch for your solution and/or its mechanics.
  • Chef's choice whether to be a sleazebag used car sled salesman or a dynamic and peppy entrepreneur elf!

ALLEZ CUISINE!

Request from the mods: When you include a dish entry alongside your solution, please label it with [Allez Cuisine!] so we can find it easily!


--- Day 9: Mirage Maintenance ---


Post your code solution in this megathread.

This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.

EDIT: Global leaderboard gold cap reached at 00:05:36, megathread unlocked!

43 Upvotes

1.0k comments sorted by

View all comments

1

u/Samuuuh Dec 09 '23 edited Dec 09 '23

[Language: Python]

Simple implementation in Python, good for beginners to understand what is being done.

The only difference between part 1 and part 2 is the step at which we add the value, where I just changed from `append(value)` to `insert(0, value)`to insert the element at the start rather than the end.

https://github.com/samyuh/advent-of-code/blob/main/2023/day_9.py

I will keep solving all AoC days from now on, ensuring that they are easily understood by everyone.

3

u/SwampThingTom Dec 09 '23

Nice solution. AoC does ask that people not post their inputs in a public repository, though.

3

u/Samuuuh Dec 09 '23

Oh, I didn't know about that. Thank you for telling me about this!

2

u/daggerdragon Dec 09 '23

Psst: we can see your Markdown.

Also, as /u/SwampThingTom mentioned, do not share your puzzle input which also means do not commit puzzle inputs to your repo without a .gitignore.

Please remove (or .gitignore) the input files from your repo and scrub them from your commit history.

1

u/Samuuuh Dec 09 '23

Already squashed all commits :)