{"id":16195297,"url":"https://github.com/tethik/advent-of-code","last_synced_at":"2025-04-07T15:54:48.040Z","repository":{"id":146621310,"uuid":"433760050","full_name":"Tethik/advent-of-code","owner":"Tethik","description":"My solutions for Advent of Code","archived":false,"fork":false,"pushed_at":"2023-12-11T13:26:11.000Z","size":2387,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-13T18:37:42.928Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tethik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-12-01T09:21:26.000Z","updated_at":"2023-12-04T10:45:52.000Z","dependencies_parsed_at":"2024-11-03T06:33:51.680Z","dependency_job_id":null,"html_url":"https://github.com/Tethik/advent-of-code","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tethik%2Fadvent-of-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tethik%2Fadvent-of-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tethik%2Fadvent-of-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tethik%2Fadvent-of-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tethik","download_url":"https://codeload.github.com/Tethik/advent-of-code/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247685597,"owners_count":20979085,"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":[],"created_at":"2024-10-10T08:26:59.220Z","updated_at":"2025-04-07T15:54:48.019Z","avatar_url":"https://github.com/Tethik.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Advent of Code\n\nMy solutions for Advent of Code.\n\n## 2023 Learnings\n\n- Copilot is awesome for writing filler (i.e. see [lib/xy.go](lib/xy.go)).\n\n- Copilot is not so awesome for creating off by one errors. I had issues with the filler on day 5 because it generated an incorrect\n  `Contains` function that was kind of annoying to debug.\n\n- Probably need something better than `string.Split` to parse strings (quickly).\n\n- Using a compiled regex pattern was actually fairly nice with Go's if syntax:\n\n```go\nif matched := numberPattern.FindStringSubmatch(line); len(matched) \u003e 0 {\n    dst := lib.MustAtoi(matched[1])\n    src := lib.MustAtoi(matched[2])\n    ran := lib.MustAtoi(matched[3])\n    currMap.Ranges = append(currMap.Ranges, Range{Src: src, Dst: dst, Ran: ran})\n}\n```\n\n- Must pattern helps clean up `if err != nil -\u003e panic` statements (see above)\n\n- To organize data I'm leaning towards putting everything into structs and implementing interfaces around them. It's a bit too painful otherwise without tuples and easy dictionaries.\n\n- Sorting is a bit odd. Seems you need to fulfill an interfaces which can be a bit cumbersome.\n\n- `slices.Reverse(someSlice)` reverses in place. Useful after sorting.\n\n- pointers are worth keeping in mind. Ended up accidentally passing a slice by reference accidentally on day 7 and being weirded out when value was still retained. `slices.Clone()` to clone a slice, but on the other hand passing references has a lot of benefit. New little hack learned, instead of cloning change value, run function, then reset back to original value. Probably cheaper than clone ;)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftethik%2Fadvent-of-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftethik%2Fadvent-of-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftethik%2Fadvent-of-code/lists"}