{"id":23875135,"url":"https://github.com/mitsunee/advent-of-code-2024","last_synced_at":"2025-08-08T13:18:15.383Z","repository":{"id":269992430,"uuid":"896643538","full_name":"Mitsunee/advent-of-code-2024","owner":"Mitsunee","description":"My solutions for Advent of Code 2024 written in TypeScript","archived":false,"fork":false,"pushed_at":"2024-12-27T15:35:23.000Z","size":214,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T00:11:13.389Z","etag":null,"topics":["advent-of-code","advent-of-code-2024"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":false,"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/Mitsunee.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":"2024-11-30T23:00:36.000Z","updated_at":"2024-12-27T15:37:28.000Z","dependencies_parsed_at":"2024-12-27T18:11:55.302Z","dependency_job_id":"7b171f26-3264-4548-901a-474f70579fc8","html_url":"https://github.com/Mitsunee/advent-of-code-2024","commit_stats":null,"previous_names":["mitsunee/advent-of-code-2024"],"tags_count":0,"template":false,"template_full_name":"foxkit-js/library-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mitsunee%2Fadvent-of-code-2024","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mitsunee%2Fadvent-of-code-2024/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mitsunee%2Fadvent-of-code-2024/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mitsunee%2Fadvent-of-code-2024/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mitsunee","download_url":"https://codeload.github.com/Mitsunee/advent-of-code-2024/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240236222,"owners_count":19769573,"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-of-code","advent-of-code-2024"],"created_at":"2025-01-03T18:17:19.904Z","updated_at":"2025-02-22T20:46:18.675Z","avatar_url":"https://github.com/Mitsunee.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Advent of Code 2024\n\nMy solutions for Advent of Code 2024 written in TypeScript\n\n## Installation\n\nInstall Node 22.x and pnpm 9.x then run\n\n```shell\npnpm install\n```\n\n## Tests\n\n```shell\npnpm typecheck \u0026\u0026 pnpm test\n```\n\n### Running a script or single test\n\nSince the code in this repository is written in TypeScript `tsx` is needed to run scripts:\n\n```shell\npnpm tsx src/day-n/script.ts\n```\n\n### Running tests for a specific day\n\nTo run all tests in only a specific directory a special `test:dir` script is used:\n\n```shell\npnpm test:dir src/day-n\n```\n\n## Prepare script\n\nTo create a src directory for starting a solution with the script template simply run `./prepare.sh`.\n\nIf used out-of-season the script also takes a day number as parameter like `./prepare.sh 06`. See also `./prepare.sh --help`.\n\n## Stars: 40/50\n\n| Week |  Monday   |  Tuesday  | Wednesday | Thursday  |  Friday   | Saturday  |  Sunday   |\n| :--: | :-------: | :-------: | :-------: | :-------: | :-------: | :-------: | :-------: |\n|  1   |           |           |           |           |           |           | 1st ⭐⭐  |\n|  2   | 2nd ⭐⭐  | 3rd ⭐⭐  | 4th ⭐⭐  | 5th ⭐⭐  | 6th ⭐⭐  | 7th ⭐⭐  | 8th ⭐⭐  |\n|  3   | 9th ⭐⭐  | 10th ⭐⭐ |  11th ⭐  | 12th ⭐⭐ |  13th ⭐  | 14th ⭐⭐ | 15th ⭐⭐ |\n|  4   |   16th    |   17th    | 18th ⭐⭐ | 19th ⭐⭐ | 20th ⭐⭐ |  21st ⭐  |  22nd ⭐  |\n|  5   | 23rd ⭐⭐ |  24th ⭐  |  25th ⭐  |\n\n### Skipped Stars:\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eDay 11 Part 2\u003c/b\u003e\u003c/summary\u003e\n\u003cp\u003eCould not come up with a solution that doesn't run out of memory in the high 30s. I'm assuming there's some sort of pattern one could take advantage of with the given ruleset, but I'm not the person to figure that out.\u003c/p\u003e\n\u003cp\u003eI also saw this is really easily solved by adding caching on top of what I already had, but sadly Map in JS only takes a single key, unlike python dicts, which makes implementing caching a lot harder.\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eDay 13 Part 2\u003c/b\u003e\u003c/summary\u003e\n\u003cp\u003eThat's just maths and it's 23:16 now and I'm too tired for this. Got some hints from reddit: Each machine has at most one solution. Apparently that means binary search is possible, but I could not figure out how to evaluate whether I'm too high or too low.\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eDay 16\u003c/b\u003e\u003c/summary\u003e\n\u003cp\u003eI have yet to actually learn a pathfinding algorithm other than bruteforce and both of my attempts at this failed. First I tried to avoid the obvious 'Maximum Callstack size exceed' error by looping over an array instead, which eventually just overfilled memory. Recursion did yield the expected error almost immediatly. Examples do work in both at least.\u003c/p\u003e\n\u003cp\u003eUpdate: I tried again with a speed optimization (using Sets and a Queue instead of arrays), but this didn't help the memory issue. I also attempted to save memory by abandoning paths that already got more expensive than the cheapest completed path, but my script was never able to actually finish a path as it kept hitting deadends.\u003c/p\u003e\n\u003cp\u003eUpdate 2: I have now actually learned Dijkstra's Shortest Path to solve day 18, so I'll likely reattempt this after I've caught up\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eDay 17\u003c/b\u003e\u003c/summary\u003e\n\u003cp\u003eCould not understand instructions, may attempt again later.\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eDay 21 Part 2\u003c/b\u003e\u003c/summary\u003e\n\u003cp\u003eNeeds some sort of caching, but with how I implemented the robots I don't know if I can even add that\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eDay 22 Part 2\u003c/b\u003e\u003c/summary\u003e\n\u003cp\u003eThis seems impossible with the amount of input lines. Would probably run out of memory if I were to generate the sequences for every input to compare, so there's likely some math nonsense going on here. Sadly I remain a freelance frontend dev, not a university professor.\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eDay 24 Part 2\u003c/b\u003e\u003c/summary\u003e\n\u003cp\u003eI was trying to analyze my input a bit, to have some assumptions to work with, so I determined I wanted to check if a swap exists that fixes 3 of the incorrect zeros. Literally the first swap my code would try after sorting by what's most likely created an infinite loop and I'm honestly out of ideas for what to try other than bruteforce (which would also need a way to detect loops)\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eDay 25 Part 2\u003c/b\u003e\u003c/summary\u003e\n\u003cp\u003eStar not available unless all other puzzles are solved\u003c/p\u003e\n\u003c/details\u003e\n\n## Previous Years I participated\n\n- [2023](https://github.com/mitsunee/advent-of-code-2023)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitsunee%2Fadvent-of-code-2024","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitsunee%2Fadvent-of-code-2024","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitsunee%2Fadvent-of-code-2024/lists"}