{"id":16870395,"url":"https://github.com/narimiran/adventofcode2021","last_synced_at":"2025-04-11T10:41:46.550Z","repository":{"id":115374696,"uuid":"433095821","full_name":"narimiran/AdventOfCode2021","owner":"narimiran","description":"My solutions for AoC 2021","archived":false,"fork":false,"pushed_at":"2024-11-29T18:08:08.000Z","size":106,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T15:27:00.385Z","etag":null,"topics":["advent","advent-of-code","advent-of-code-2021","advent-of-code-2021-python","adventofcode","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/narimiran.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-29T15:27:12.000Z","updated_at":"2024-11-29T18:08:12.000Z","dependencies_parsed_at":"2024-11-29T19:21:48.030Z","dependency_job_id":"82ec8b60-4caa-4c07-9067-df9cb7a21383","html_url":"https://github.com/narimiran/AdventOfCode2021","commit_stats":{"total_commits":44,"total_committers":1,"mean_commits":44.0,"dds":0.0,"last_synced_commit":"2a75a87046868a819716bea767f2793086cb0bb6"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narimiran%2FAdventOfCode2021","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narimiran%2FAdventOfCode2021/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narimiran%2FAdventOfCode2021/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narimiran%2FAdventOfCode2021/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/narimiran","download_url":"https://codeload.github.com/narimiran/AdventOfCode2021/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248377715,"owners_count":21093864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["advent","advent-of-code","advent-of-code-2021","advent-of-code-2021-python","adventofcode","python","python3"],"created_at":"2024-10-13T15:04:12.431Z","updated_at":"2025-04-11T10:41:46.518Z","avatar_url":"https://github.com/narimiran.png","language":"Python","readme":"# Advent of Code 2021\n\nAll my Advent of Code repos:\n\n* [AoC 2015 in Nim, Python](https://github.com/narimiran/advent_of_code_2015)\n* [AoC 2016 in Python, Clojure (+ visualizations)](https://github.com/narimiran/advent_of_code_2016)\n* [AoC 2017 in Nim, OCaml, Python](https://github.com/narimiran/AdventOfCode2017)\n* [AoC 2018 in Nim, Python, Racket](https://github.com/narimiran/AdventOfCode2018)\n* [AoC 2019 in OCaml, Python](https://github.com/narimiran/AdventOfCode2019)\n* [AoC 2020 in Nim, one liner-y Python, Racket](https://github.com/narimiran/AdventOfCode2020)\n* [AoC 2021 in Python, Racket](https://github.com/narimiran/AdventOfCode2021) (this repo)\n* [AoC 2022 in Python, Clojure](https://github.com/narimiran/AdventOfCode2022)\n* [AoC 2023 in Clojure](https://github.com/narimiran/AdventOfCode2023)\n* [AoC 2024 in Clojure (Clerk notebooks)](https://github.com/narimiran/aoc2024)\n\n\n\u0026nbsp;\n\nThis year it is back to roots - Python!\n\nI'll probably add solutions in other languages on some later date.\n\nEDIT, November 2022: And I did - I've solved initial days in Racket too.\n\n\n\n## Solutions\n\n\nTask                                                                      | Python Solution              | Racket Solution               | Comment for Python solution\n---                                                                       | ---                          | ---                           | ---\nDay 00: Helper file                                                       | [aoc.py](python/aoc.py)      | [aoc.rkt](racket/aoc.rkt)     | Utilities to use for solving the tasks.\n[Day 01: Sonar Sweep](http://adventofcode.com/2021/day/1)                 | [day01.py](python/day01.py)  | [day01.rkt](racket/day01.rkt) | `(a + b + c) \u003c (b + c + d)` --\u003e `a \u003c d`\n[Day 02: Dive!](http://adventofcode.com/2021/day/2)                       | [day02.py](python/day02.py)  | [day02.rkt](racket/day02.rkt) | \"Up, up, down, down, left, right, left, right...\"\n[Day 03: Binary Diagnostic](http://adventofcode.com/2021/day/3)           | [day03.py](python/day03.py)  | [day03.rkt](racket/day03.rkt) | ` from collections import Counter`\n[Day 04: Giant Squid](http://adventofcode.com/2021/day/4)                 | [day04.py](python/day04.py)  | [day04.rkt](racket/day04.rkt) | Set operations (`\u003c=`, `-`) to the rescue.\n[Day 05: Hydrothermal Venture](http://adventofcode.com/2021/day/5)        | [day05.py](python/day05.py)  | [day05.rkt](racket/day05.rkt) | TIL `defaultdict` is faster than `Counter`.\n[Day 06: Lanternfish](http://adventofcode.com/2021/day/6)                 | [day06.py](python/day06.py)  | [day06.rkt](racket/day06.rkt) | Recursion with memoization.\n[Day 07: The Treachery of Whales](http://adventofcode.com/2021/day/7)     | [day07.py](python/day07.py)  | [day07.rkt](racket/day07.rkt) | Mean `mean`!\n[Day 08: Seven Segment Search](http://adventofcode.com/2021/day/8)        | [day08.py](python/day08.py)  | [day08.rkt](racket/day08.rkt) | Using Python 3.10 and pattern matching.\n[Day 09: Smoke Basin](http://adventofcode.com/2021/day/9)                 | [day09.py](python/day09.py)  | [day09.rkt](racket/day09.rkt) | Recursive DFS.\n[Day 10: Syntax Scoring](http://adventofcode.com/2021/day/10)             | [day10.py](python/day10.py)  | [day10.rkt](racket/day10.rkt) | `dict(zip(...))` for easier typing\n[Day 11: Dumbo Octopus](http://adventofcode.com/2021/day/11)              | [day11.py](python/day11.py)  | [day11.rkt](racket/day11.rkt) | Iterative DFS.\n[Day 12: Passage Pathing](http://adventofcode.com/2021/day/12)            | [day12.py](python/day12.py)  | [day12.rkt](racket/day12.rkt) | Recursive DFS generator with `yield from`.\n[Day 13: Transparent Origami](http://adventofcode.com/2021/day/13)        | [day13.py](python/day13.py)  | [day13.rkt](racket/day13.rkt) | Fold. Not `fold`.\n[Day 14: Extended Polymerization](http://adventofcode.com/2021/day/14)    | [day14.py](python/day14.py)  |                               | `Counter` to the rescue.\n[Day 15: Chiton](http://adventofcode.com/2021/day/15)                     | [day15.py](python/day15.py)  |                               | Dijkstra.\n[Day 16: Packet Decoder](http://adventofcode.com/2021/day/16)             | [day16.py](python/day16.py)  |                               | `iter` for some elegant stream implementation.\n[Day 17: Trick Shot](http://adventofcode.com/2021/day/17)                 | [day17.py](python/day17.py)  |                               | Analytical + brute force.\n[Day 18: Snailfish](http://adventofcode.com/2021/day/18)                  | [day18.py](python/day18.py)  |                               | My first ever `eval` in 7 instances of AoC.\n[Day 19: Beacon Scanner](http://adventofcode.com/2021/day/19)             | [day19.py](python/day19.py)  |                               |\n[Day 20: Trench Map](http://adventofcode.com/2021/day/20)                 | [day20.py](python/day20.py)  |                               | I had 9-neighbours helper ready.\n[Day 21: Dirac Dice](http://adventofcode.com/2021/day/21)                 | [day21.py](python/day21.py)  |                               | Lanternfish says hi!\n[Day 22: Reactor Reboot](http://adventofcode.com/2021/day/22)             | [day22.py](python/day22.py)  |                               |\n[Day 23: Amphipod](http://adventofcode.com/2021/day/23)                   | [day23.py](python/day23.py)  |                               |\n[Day 24: Arithmetic Logic Unit](http://adventofcode.com/2021/day/24)      | [day24.py](python/day24.py)  |                               |\n[Day 25: Sea Cucumber](http://adventofcode.com/2021/day/25)               | [day25.py](python/day25.py)  |                               |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarimiran%2Fadventofcode2021","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnarimiran%2Fadventofcode2021","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarimiran%2Fadventofcode2021/lists"}