All my Advent of Code repos:
- AoC 2015 in Nim, Python
- AoC 2016 in Python
- AoC 2017 in Nim, OCaml, Python
- AoC 2018 in Nim, Python, Racket
- AoC 2019 in OCaml, Python
- AoC 2020 in Nim, one liner-y Python, Racket
- AoC 2021 in Python (this repo)
This year it is back to roots - Python!
I'll probably add solutions in other languages on some later date.
Task | Python Solution | Comment |
---|---|---|
Day 00: Helper file | aoc.py | Utilities to use for solving the tasks. |
Day 01: Sonar Sweep | day01.py | (a + b + c) < (b + c + d) --> a < d |
Day 02: Dive! | day02.py | "Up, up, down, down, left, right, left, right..." |
Day 03: Binary Diagnostic | day03.py | from collections import Counter |
Day 04: Giant Squid | day04.py | Set operations (<= , - ) to the rescue. |
Day 05: Hydrothermal Venture | day05.py | TIL defaultdict is faster than Counter . |
Day 06: Lanternfish | day06.py | Recursion with memoization. |
Day 07: The Treachery of Whales | day07.py | Mean mean ! |
Day 08: Seven Segment Search | day08.py | Using Python 3.10 and pattern matching. |
Day 09: Smoke Basin | day09.py | Recursive DFS. |
Day 10: Syntax Scoring | day10.py | dict(zip(...)) for easier typing |
Day 11: Dumbo Octopus | day11.py | Iterative DFS. |
Day 12: Passage Pathing | day12.py | Recursive DFS generator with yield from . |
Day 13: Transparent Origami | day13.py | Fold. Not fold . |
Day 14: Extended Polymerization | day14.py | Counter to the rescue. |
Day 15: Chiton | day15.py | Dijkstra. |
Day 16: Packet Decoder | day16.py | iter for some elegant stream implementation. |
Day 17: Trick Shot | day17.py | Analytical + brute force. |
Day 18: Snailfish | day18.py | My first ever eval in 7 instances of AoC. |
Day 19: Beacon Scanner | day19.py | |
Day 20: Trench Map | day20.py | I had 9-neighbours helper ready. |
Day 21: Dirac Dice | day21.py | Lanternfish says hi! |
Day 22 | day22.py | |
Day 23 | day23.py | |
Day 24 | day24.py | |
Day 25 | day25.py |