This holiday season I have decided for the first time to partake in the 2022 Advent of Code (AOC) challenge. The AOC challenge presents two sets of problems every day leading up to Christmas day. In light of the Christmas spirit, I will be documenting all my solutions and providing detailed and precise annotations to allow potential readers to improve in future AOC challenges.
INPUT DATA WILL NOT BE INCLUDED IN THE GIT REPO IN ACCORDANCE WITH THE RULES AND WISHES OF THE AOC'S CREATOR. YOU WILL SEE FILES WITH THE FILE TYPE .gpg
WHICH ARE JUST ENCRYPTED TEXT FILES. SO PLEASE DEFINE YOUR OWN input.txt
AND test.txt
FILES TO UTILIZE THE CODEBASE SOLUTIONS.
Day | Part 1 | Part 2 |
---|---|---|
1 | ⭐ | ⭐ |
2 | ⭐ | ⭐ |
3 | ⭐ | ⭐ |
4 | ⭐ | ⭐ |
5 | ⭐ | ⭐ |
6 | ⭐ | ⭐ |
7 | ⭐ | ⭐ |
8 | ⭐ | ⭐ |
9 | ⭐ | ⭐ |
The solutions posted will be more polished than their initial state used to complete the AOC challenges and can be found under the solutions/*
directory.
This repository will be structured in the following way, for every day of the challenges there will be a folder named
dayi
, where i
is an integer detailing the day of the challenge. With two sub folders dayi/partA
and dayi/partB
each containing four files: input.txt
, test.txt
,solution.py
and README.MD
.
input.txt
is the text file containing the input file of the problem settest.txt
is the text file containing a test case of the problem setsolution.py
is the python file containing the solutionREADME.md
provides further insight into how the solution works and the nature of the solution and problem
As programmers, we are occasionally told to write optimized and highly efficient code. However, this is not the place for it in my opinion. The AOC challenges measure a programmer's proficiency in writing code quickly and code optimization simply serves no purpose in these challenges as the provided input.txt
files are small in nature. Hence, even if we were to optimize the codebase these optimizations will not be realized in these challenges.
So my posted solutions are a result of two main points of focus:
- Writing code that is readable
- Writing code quickly without regard for optimizations
We want to write readable code because typically the second part of the problem set will require you to build upon your pre-existing codebase.
Secondly, to make the leaderboard we can't spend time optimizing code as that will result in no noticeable benefits and will just increase your submission time.
Note that each problem has a input file that is feed into the script but this input data is not the same for all users
and thus make sure to use your own input file to run against the script to get accurate results for your tailored problem.
i.e the input.txt
might differ from person to person, so make sure to use your own data set to calculate the answer
properly for your inputs.