Skip to content

Latest commit

 

History

History
40 lines (35 loc) · 4.36 KB

README.md

File metadata and controls

40 lines (35 loc) · 4.36 KB

Advent of Code 2023

For the sixth time I'm trying to find out how far I can make it in Advent of Code. Results for previous editions:

  • 2018: 9 days
  • 2019: 13 days
  • 2020: 25 days for the first time!
  • 2021: 25 days for the second time!
  • 2022: 25 days for the third time!

The wonderful AoC community on reddit helped me a lot, once again. Visualisations on the AoC subreddit pointed me towards the proper algorithm for Day 10 part 2, then debug Day 19. I needed to peek at other participants' attempts to modify Dijkstra's algorithm to solve Day 17, and to change my approaches for Day 20 part 2 (turned out I had a good idea and a stupid implementation error) and Day 22 part 1. Another hint helped me combine Pick's theorem with the shoelace formula for Day 18. I genuinely needed a tutorial to grasp the recursive thinking necessary for Day 12.

As of 7.01.2024: parts 2 of Days 21 and 24 are on the to-do list until I get an idea how to approach them.

Things I Learned, Revised or Improved at in 2023:

  • Day 1 Python: debugging off-by-one errors (I), iterating with two pointers (R) and re.findall & re.search (R), because I procrastrinated by implementing this one with two methods
  • Day 2 Python: itertools.chain (L)
  • Day 3 Python: set operations (R), first steps with Pylint (L)
  • Day 4 Python: using dictionaries of dictionaries to store data (R)
  • Day 5 Python: using Python as a hand calculator, really...and finding overlaps of intervals in my not-yet-implemented alternative solution (R)
  • Day 6 Python: implementing quadratic equations (R)
  • Day 7 Python: collections.Counter (R), creating hashable objects and with custom comparators (R), reading comprehension (OMG)
  • Day 8 Python: itertools.cycle (R)
  • Day 9 Python: deque (R)
  • Day 10 Python: the even-odd algorithm (L) although the implementation is not perfect (works for the acutal input, gives off-by-one errors on test data)
  • Day 11 Python: deepcopy (R), itertools.combinations (R), Manhattan distance (R)
  • Day 12 Python: recursion (I), functools.cache (I), treating booleans as ints (R)
  • Day 13 Python: hash() for the original part 1 solution (R), enumerate for the second approach that also solved part 2 (R)
  • Day 14 Python: using hashmaps for 2d array operations (R), hash() for storing states to detect cycle (R)
  • Day 15 Python: dictionaries/hashmaps (R), enums (R), regex (R), getting used to enumerate instead of for-loops (I)
  • Day 16 Python: iterative BFS (I)
  • Day 17 Python: Dijkstra's algorithm (I) with a twist!
  • Day 18 Python: the shoelace formula (L) and Pick's theorem (L)
  • Day 19 Python: spotting tree structures (I) and traversing them with BFS (I), deepcopy (R)
  • Day 20 Python: creating hashable objects for the original part 1 solution (R), itertools.count (L) for a proper and simplified solution that got rid of OOP, graphviz (L) for a visualisation that helped me figure out how the input works
  • Day 21 Python: Dijkstra's algorithm (R), part 2 TO DO
  • Day 22 Python: defaultdict with a lambda expression in the constructor (L), iterative BFS (R)
  • Day 23 Python iterative and recursive DFS (R), topological sorting (L), longest path problem (L), working with directed acyclic and cyclic graphs (I)
  • Day 24 Python: finding line intersections in Euclidean geometry (R), part 2 TO DO
  • Day 25 Python: networkx (L), graphviz (L) and argparse (L) for a 'smart' solution that requires eyeballing the graph