Python code to solve daily puzzles of http://adventofcode.com/2022
Code is tested with Python 3.9.7 (Anaconda distribution) on Win10. Developed with VSCode.
- Day 1: Reading a list, sum over some partitions. From looking at solutions on Reddit, it seems like most people followed the same algorithm, but the fastest did the parsing with lots less typing/effort. 08:33(4725) / 11:09(4164)
- Day 2: Rock paper scissors, with part 2 requiring one to pick the winning/losing/drawing action. 17:25(7048) / 30:25(8234) due to distractions.
- Day 3: Set intersections, made easy by Python 'set'. 13:13(4341) / 19:14(3538)
- Day 4: Another set intersection question. Got started late: 30:10 11599, 32:17 10092
- Day 5: Move items between stacks by a set of instructions, popping/append or (part 1) moving whole sections at a time. Some more complex input parsing too, and solutions on Reddit seemed to have people that simply hardcoded it. 40:18 7927 / 59:23 9804
- Day 6: Iterate through a string to find first set of unique characters. Pretty straightforward with collections.Counter. 15:24 9398 / 17:27 8572
- Day 7: Parse command-line commands + results to determine a directory tree, and then do some size calculations. Lots of parsing / typing, and I'm amazed that some people did it in ~5 minutes. 49:34 4770 / 1:11:57 5981
- Day 8: Look along a matrix in a couple of directions. Just did it more-or-less brute force, but there must have been a faster way to do this. 33:20 6237 / 1:00:41 6490
- Day 9: Have a point follow around another. Part 2 extended it to a whole list of points, like a rope flapping in the breeze. 39:11 5656 / 1:05:46 4782
- Day 10: Follow instructions to increment a register (not unusual for AoC!). Part 2 involved using the evolution of it to write a message in pixel art!. 27:18 5813 / 43:58 4346
- Day 11: Modulo math for monkeys. Honestly, I used help from Reddit for Part 2 (where one needed to figure out a way of keeping integer values reasonably-sized). The (supposedly) key observation is that all monkeys are looking for divisions of primes, so dividing the worry number by any multiple of that prime would result in the same modulo, so the trick is to divide the worry number by the product of all of the monkey divisors. Kudos to those who saw it! 45:19 4019 / 22:37:05 39098
- Day 12: Path search, made somewhat simpler via the astar routine that I've used in previous years. The trick was to create a custom network by parsing the data. But I worked on it the next day. 23:32:56 34941 / 23:47:19 34028
- https://github.com/jborlik/AdventOfCode2015
- https://github.com/jborlik/AdventOfCode2016
- https://github.com/jborlik/AdventOfCode2017
- https://github.com/jborlik/AdventOfCode2018
- https://github.com/jborlik/AdventOfCode2019
- https://github.com/jborlik/AdventOfCode2020
- https://github.com/jborlik/AdventOfCode2021