{"id":43310767,"url":"https://github.com/devries/advent_of_code_2022","last_synced_at":"2026-02-01T21:11:01.565Z","repository":{"id":62865058,"uuid":"542209410","full_name":"devries/advent_of_code_2022","owner":"devries","description":"The most wonderful time of the year!","archived":false,"fork":false,"pushed_at":"2023-05-01T14:25:07.000Z","size":125,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-10T13:54:55.718Z","etag":null,"topics":["advent-of-code","advent-of-code-2022"],"latest_commit_sha":null,"homepage":"","language":"Go","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/devries.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-09-27T17:30:20.000Z","updated_at":"2022-09-27T17:47:14.000Z","dependencies_parsed_at":"2024-06-20T17:18:34.182Z","dependency_job_id":"819699be-e09b-4239-be74-ba047b756100","html_url":"https://github.com/devries/advent_of_code_2022","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devries/advent_of_code_2022","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devries%2Fadvent_of_code_2022","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devries%2Fadvent_of_code_2022/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devries%2Fadvent_of_code_2022/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devries%2Fadvent_of_code_2022/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devries","download_url":"https://codeload.github.com/devries/advent_of_code_2022/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devries%2Fadvent_of_code_2022/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28991204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T20:57:35.821Z","status":"ssl_error","status_checked_at":"2026-02-01T20:57:29.580Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-of-code","advent-of-code-2022"],"created_at":"2026-02-01T21:11:00.975Z","updated_at":"2026-02-01T21:11:01.557Z","avatar_url":"https://github.com/devries.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Advent of Code 2022\n\n[![Tests](https://github.com/devries/advent_of_code_2022/actions/workflows/main.yml/badge.svg)](https://github.com/devries/advent_of_code_2022/actions/workflows/main.yml)\n[![Stars: 50](https://img.shields.io/badge/⭐_Stars-50-yellow)](https://adventofcode.com/2022)\n\n## Plan for This Year\n\nThis year I will be using Go once again, but in an effort to do something\ndifferent I will be using [GitHub codespaces](https://docs.github.com/en/codespaces)\nin order to see how well it works for someone who likes to work in the command\nline. \n\nI'll be using the [GitHub CLI](https://cli.github.com/) in order to connect with\nmy codespace (using SSH) and have a [dotfiles configuration](https://github.com/devries/dotfiles)\nwhich installs my preferred editor ([Neovim](https://neovim.io/)) and tmux so\nI can work comfortably. I should be able to stick to the free tier (60 hours of\nusage and 15 GB-months storage) for Advent of Code, and it gives me enough\ntime to see if working through codespaces is something that I enjoy. The big\ndown side is likely to be the delay caused by working over an SSH connection. I\nam not a big fan of Neovim's remote editing feature, so I plan to run Neovim\non the remote codespace.\n\nIt seems like cloud-hosted development environments are becoming more common, so\nI look forward to seeing how this experiment pans out.\n\n## Index\n\n- [Day 1: Calorie Counting](https://adventofcode.com/2022/day/1) - [part 1](day01_p1/main.go), [part 2](day01_p2/main.go)\n\n  Codespaces did have a bit of a delay over ssh, though that was fairly manageable.\n  When saving the file the first time it took the linter some time to get going\n  and also it appears that codespaces does not have `goimports` installed by\n  default, so I had to look up the standard library imports rather than rely on\n  the go tooling. It's all the little things that make a development environment\n  work.\n\n- [Day 2: Rock Paper Scissors](https://adventofcode.com/2022/day/2) - [part 1](day02_p1/main.go), [part 2](day02_p2/main.go)\n\n  I added `goimports` to my environment and things ran fairly smoothly. The delay\n  is still just enough to be slightly annoying.\n\n- [Day 3: Rucksack Reorganization](https://adventofcode.com/2022/day/3) - [part 1](day03_p1/main.go), [part 2](day03_p2/main.go)\n\n  Bit arithmetic makes an appearance!\n\n- [Day 4: Camp Cleanup](https://adventofcode.com/2022/day/4) - [part 1](day04_p1/main.go), [part 2](day04_p2/main.go)\n\n- [Day 5: Supply Stacks](https://adventofcode.com/2022/day/5) - [part 1](day05_p1/main.go), [part 2](day05_p2/main.go)\n\n  I decided to stop using codespaces. It was fine, but the small amount of delay\n  over ssh was noticeable and unnecessary considering I am at my computer.\n\n- [Day 6: Tuning Trouble](https://adventofcode.com/2022/day/6) - [part 1](day06_p1/main.go), [part 2](day06_p2/main.go)\n\n  One thing python has which Go does not have in its standard library are tools\n  to find combinations and permutations of values from a list. Luckily I wrote\n  some for an earlier advent of code. I separated them into a separate library\n  at [github.com/devries/combs](https://github.com/devries/combs).\n\n- [Day 7: No Space Left On Device](https://adventofcode.com/2022/day/7) - [part 1](day07_p1/main.go), [part 2](day07_p2/main.go)\n\n  A little tree work.\n\n- [Day 8: Treetop Tree House](https://adventofcode.com/2022/day/8) - [part 1](day08_p1/main.go), [part 2](day08_p2/main.go)\n\n  And now for actual trees. I always have a little trouble when I am trying to\n  measure that a condition does not occur in any of N possibilities. \n\n- [Day 9: Rope Bridge](https://adventofcode.com/2022/day/9) - [part 1](day09_p1/main.go), [part 2](day09_p2/main.go)\n\n  Fairly straightforward, but I like moving around maps.\n\n- [Day 10: Cathode-Ray Tube](https://adventofcode.com/2022/day/10) - [part 1](day10_p1/main.go), [part 2](day10_p2/main.go)\n\n  This one seemed pretty easy. I was expecting repeating the cycles for some large\n  number of times in part 2, but instead I got to take advantage of my AoC OCR\n  utility.\n\n- [Day 11: Monkey in the Middle](https://adventofcode.com/2022/day/11) - [part 1](day11_p1/main.go), [part 2](day11_p2/main.go)\n\n  I naively decided to try using the big integer library before just running a\n  modulo least common multiple on each worry operation. A little bit of a\n  detour for part 2 it turns out. Also, took me a while to parse.\n\n- [Day 12: Hill Climbing Algorithm](https://adventofcode.com/2022/day/12) - [part 1](day12_p1/main.go), [part 2](day12_p2/main.go)\n\n  A nice little reversal (literally) at the end where you have to find the starting\n  point with the shortest path to the end. Turns out it is easy to just start at\n  the end and do a breadth first search until you find the first location with\n  altitude 'a'.\n\n- [Day 13: Distress Signal](https://adventofcode.com/2022/day/13) - [part 1](day13_p1/main.go), [part 2](day13_p2/main.go)\n\n  I had a few bugs in the packet parser hitting a comma when I expected a left bracket\n  or an integer, but eventually I found the issue. After that the comparisons were\n  fairly easy. I completed this in a similar was as I did the Snail math problem last\n  year, with an interface type that could hold an integer to a list of those interfaces.\n\n- [Day 14: Regolith Reservoir](https://adventofcode.com/2022/day/14) - [part 1](day14_p1/main.go), [part 2](day14_p2/main.go)\n\n  I read the problem and thought this was going to be one of the problems where\n  efficiency would be an issue, but it turned out to be straightforward. Unfortunately\n  my flow was interrupted by a meeting between parts 1 and 2.\n\n- [Day 15: Beacon Exclusion Zone](https://adventofcode.com/2022/day/15) - [part 1](day15_p1/main.go), [part 2](day15_p2/main.go)\n\n  Not a lot to say about this problem. I should make my utils.Point methods generic\n  so they work on int64, but it was faster just to define int64 structs for points\n  and for ranges. This time my overlap function was simpler than the last time we\n  did a problem like this.\n\n- [Day 16: Proboscidea Volcanium](https://adventofcode.com/2022/day/16) - [part 1](day16_p1/main.go), [part 2](day16_p2/main.go)\n\n  To solve this I calculated the distances between any two valves in seconds\n  elapsed and restricted myself to traveling only to valves that had a flow \u003e\n  0. For the first part I essentially found the distances between all valves\n  and then recursively did a depth first search through all possible paths that\n  could be done within the time limit. For part 2, initially I split the valves between the\n  two players and found all combinations of valves each player could have. I then\n  restricted each player's parameter space to their assigned valves.\n  Iterating through all the possibilities, even with memoization, took around\n  a minute, and that solution is in [slow part 2](day16_p2slow/main.go), but after\n  that I went looking for hints and found that you could essentially keep a combined\n  list of all the valves and just run player 1, reset the clock, and run player 2. Reducing\n  the state to time elapsed, position, player (I used \"A\" or \"B\"), and open valves\n  reduced the run time to a few seconds. This was a very interesting problem.\n\n- [Day 17: Pyroclastic Flow](https://adventofcode.com/2022/day/17) - [part 1](day17_p1/main.go), [part 2](day17_p2/main.go)\n\n  This problem is notable because the power went out in my house and has been\n  out for about 36 hours now. I finally evacuated to my in-laws house and brought\n  my laptop to do the problem. It's basically tetris without rotations, and for\n  the second part you have to find a repeating cycle of pieces and motions with\n  the same starting grid pattern. I encoded each row of the grid as a uint8 and\n  then hashed that array to find a grid value I could use as a key in a go map.\n  \n- [Day 18: Boiling Boulders](https://adventofcode.com/2022/day/18) - [part 1](day18_p1/main.go), [part 2](day18_p2/main.go)\n\n  I ended up filling the grid with water blocks to see where it could get. Then\n  I counted the number of water blocks adjacent to each rock block.\n\n- [Day 19: Not Enough Minerals](https://adventofcode.com/2022/day/19) - [part 1](day19_p1/main.go), [part 2](day19_p2/main.go)\n\n  This was very unpleasant for me. For a while I thought I had a few \"off by one\"\n  errors, but it turns out it was just misreading the problem. By then I had started\n  on a new approach using a BFS. It took a lot of trial and error to figure out\n  how to cull the queue adequately and even now it's not great.\n\n- [Day 20: Grove Positioning System](https://adventofcode.com/2022/day/20) - [part 1](day20_p1/main.go), [part 2](day20_p2/main.go)\n\n  After yesterday's doozy of a problem, at least today was nice and simple.\n\n- [Day 21: Monkey Math](https://adventofcode.com/2022/day/21) - [part 1](day21_p1/main.go), [part 2](day21_p2/main.go)\n\n  The first part of this problem was nice and simple. I put everything in RPN\n  and completed the calculation using a stack. The next part broke my brain. I\n  just wasn't getting what my errors were, and so I decided to go to sleep. The\n  next morning I remembered how subtraction and division worked.\n\n- [Day 22: Monkey Map](https://adventofcode.com/2022/day/22) - [part 1](day22_p1/main.go), [part 2](day22_p2/main.go)\n\n  I spent too long building a general algorithm for working out how to navigate\n  the cube. I think it works in many cases, but I found one configuration which\n  doesn't work. What I did was find the points outside the map that were touching\n  two sides of the map. I then walked along the edge of each map in each direction\n  and set up points to warp from one edge to another. It seems like if only\n  one runner has to make a 90 degree turn, then the edges will still touch, but\n  if both do, then you stop.\n\n- [Day 23: Unstable Diffusion](https://adventofcode.com/2022/day/23) - [part 1](day23_p1/main.go), [part 2](day23_p2/main.go)\n\n  I love these cellular automaton problems. I created a hash map with the elf's\n  current position as a key and previous position as a value. If there were collision\n  I would move each elf back to its previous position. And to check if any\n  elves moved I just had to wait until every key equaled its value.\n\n- [Day 24: Blizzard Basin](https://adventofcode.com/2022/day/24) - [part 1](day24_p1/main.go), [part 2](day24_p2/main.go)\n\n  This is a relatively straightforward BFS search with a map that changes each step.\n  The total number of map configurations is the LCM of the map width and height, which\n  for my case was 600 states which I precalculated. The tough part for me was finding\n  the set of states I had already seen during the search. I didn't take the map\n  configuration into account initially, which did not allow me to return to any\n  point or remain in a point. Once I cleared that up, the problem was pretty \n  quick.\n\n- [Day 25: Full of Hot Air](https://adventofcode.com/2022/day/25) - [part 1](day25_p1/main.go)\n\n  Well, that's a weird number system.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevries%2Fadvent_of_code_2022","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevries%2Fadvent_of_code_2022","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevries%2Fadvent_of_code_2022/lists"}