As others have said, part 2 of today's was really difficult. I finally solved it using Python regex `overlapped=true`, but it was very tricky. The irritation of having all of the test cases passing, but it failing for my challenge input! I hope it doesn't scare off newcomers, but I already know a few who have given up on part 2.
Advent of Code 2023 is nigh
151–160 of 319 posts
Re: Advent of Code 2023 is nigh
#152Earlier quoted context omitted.
Same here. I would've really like if the spec specifically mentioned the possibility of that one edge case ahead of time instead of having to sift through the 1000 lines of input. No hate on AOC though, I really respect all the hard work that goes into it.
Unless the question has been edited recently, it did. There are multiple lines in the second example input that show the overlap: > eightwothree > 4nineeightseven2 > zoneight234 I test my AoC solutions incrementally by printing output, so I found that I was failing to produce the correct list of numbers in a line right away. I suppose if you're taking a faster approach and just trying to extract the first and last nu…
Meaning:
- eightwothree -> 823 (answer 83)
- 4nineeightseven2 -> 49872 (answer 42)
- zoneight234 -> z18234 (answer 14)
I interpreted the instructions as saying to take the first match from the left and not count the overlaps.
Unfortunately this gives the same answer as the overlap interpretation on the examples given in the problem statement: all the overlaps occurred in the middle where they didn't matter.
If they had shown
oneight -> answer: 18
then I would have understood the spec.
Re: Advent of Code 2023 is nigh
#153Re: Advent of Code 2023 is nigh
#154Earlier quoted context omitted.
I do them in Elixir and I find it to be a great language for this kind of thing. I'm not a very sophisticated Elixir programmer, but I think my solutions are decent enough (and readable, for the most part!). I have a repo which has solutions for quite a few of the puzzles, along with some nifty little mix tasks to help set up a skeleton for each day's puzzle and automatically fetch the input file. If you're intereste…
Elixir is great for this, especially with Livebook ( https://livebook.dev/ ) and kino_aoc ( https://github.com/ljgago/kino_aoc ).
Re: Advent of Code 2023 is nigh
#155Earlier quoted context omitted.
I used it last year to exercise my utterly novice clojure skills and found that very enjoyable and educational.
I especially enjoy using Clojure for these puzzles since the REPL makes interactively checking your ideas fast.
I wish Elixir's REPL / editor integration was half as awesome as SLIME / Emacs, but it's still leaps and bounds beyond what you get in most non-functional langs.
Re: Advent of Code 2023 is nigh
#156Part two was exceptionally hard. Many people on reddit reporting they were hit by one edge case that's not covered in the examples. But my implementation passed these edge cases too. I was hit by another edge case. So there are at least two edge-cases (which are in the actual data) that aren't covered in the examples or the description.
Generally, such edge-cases usually make the solution ugly and the process unpleasant. The aim of such puzzles should be a pleasant process culminating with a beautiful solution.
https://github.com/williamcotton/fs_playground/blob/ffbc57ac...
Re: Advent of Code 2023 is nigh
#157As others have said, part 2 of today's was really difficult. I finally solved it using Python regex `overlapped=true`, but it was very tricky. The irritation of having all of the test cases passing, but it failing for my challenge input! I hope it doesn't scare off newcomers, but I already know a few who have given up on part 2.
https://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_algorithm
Re: Advent of Code 2023 is nigh
#158Re: Advent of Code 2023 is nigh
#159Last year there were people solving the puzzles with LLMs, but I don't think I saw anyone get past day 5 or so. I'm interested in how well it goes this year. Please reply if you are trying yourself or can link to public attempts by others
Out of curiosity after finishing my solution, I tried it with chatgpt 4.0 Part1 worked after me explaining a tiny bug. Part2 however never worked. Even after explaining exactly where the bug was in the python solution got came up with, it couldn’t fix it. It was quite fascinating watching it try over and over with different approaches, but it couldn’t even get the example working. This just goes to show how good of a…
It's funny to read this a year later, and filter it through my experiences with ChatGPT over the last year. Some of it still rings true, some of it would probably be much improved with GPT-4. But the places where the LLM fell down in my examples are still the same kinds of issues you get using GPT as an assistant today.
If you're interested: https://epiccoleman.com/posts/2022-12-03-chatgpt-aoc
Re: Advent of Code 2023 is nigh
#160I don't know if I'll even bother this year. Their puzzles start feeling like chores by the 10th problem or so and I drop out. Maybe I'll learn a new language to spice it up this year.