Home

Awesome

Advent of Code 2021

All my Advent of Code repos:

 

This year it is back to roots - Python!

I'll probably add solutions in other languages on some later date.

EDIT, November 2022: And I did - I've solved initial days in Racket too.

Solutions

TaskPython SolutionRacket SolutionComment for Python solution
Day 00: Helper fileaoc.pyaoc.rktUtilities to use for solving the tasks.
Day 01: Sonar Sweepday01.pyday01.rkt(a + b + c) < (b + c + d) --> a < d
Day 02: Dive!day02.pyday02.rkt"Up, up, down, down, left, right, left, right..."
Day 03: Binary Diagnosticday03.pyday03.rkt from collections import Counter
Day 04: Giant Squidday04.pyday04.rktSet operations (<=, -) to the rescue.
Day 05: Hydrothermal Ventureday05.pyday05.rktTIL defaultdict is faster than Counter.
Day 06: Lanternfishday06.pyday06.rktRecursion with memoization.
Day 07: The Treachery of Whalesday07.pyday07.rktMean mean!
Day 08: Seven Segment Searchday08.pyday08.rktUsing Python 3.10 and pattern matching.
Day 09: Smoke Basinday09.pyday09.rktRecursive DFS.
Day 10: Syntax Scoringday10.pyday10.rktdict(zip(...)) for easier typing
Day 11: Dumbo Octopusday11.pyday11.rktIterative DFS.
Day 12: Passage Pathingday12.pyday12.rktRecursive DFS generator with yield from.
Day 13: Transparent Origamiday13.pyday13.rktFold. Not fold.
Day 14: Extended Polymerizationday14.pyCounter to the rescue.
Day 15: Chitonday15.pyDijkstra.
Day 16: Packet Decoderday16.pyiter for some elegant stream implementation.
Day 17: Trick Shotday17.pyAnalytical + brute force.
Day 18: Snailfishday18.pyMy first ever eval in 7 instances of AoC.
Day 19: Beacon Scannerday19.py
Day 20: Trench Mapday20.pyI had 9-neighbours helper ready.
Day 21: Dirac Diceday21.pyLanternfish says hi!
Day 22: Reactor Rebootday22.py
Day 23: Amphipodday23.py
Day 24: Arithmetic Logic Unitday24.py
Day 25: Sea Cucumberday25.py