Time for a new thread for a new week?
gerikson
relevant to this sub's interest is this Reddit thread about "LLM cheaters" in AoC:
https://old.reddit.com/r/adventofcode/comments/1h9cub8/discussion_on_llm_cheaters/
this looks like the same issue I had!
day 8 part 2
Eric added some 0
s in the grid which fucked up my existence code, sneaky devil
re: branch cutting
thanks for the tip, I looked into it again and I found I was cutting in the wrong place. Fixed now, and halves the time for part 2
Re: day 7 parts 1 and 2
same here, I was dicking around with combinatorics to get all combos of plus and multiply but realized before I got to the end it was gonna take too long. Then I figured that a DFS was the way to go.
I tried to optimize a bit by exiting early if the cumulative result became too large, but for some reason that gave me incorrect (too low) answers. Part 2 runs in around 1 min anyway.
https://github.com/gustafe/aoc2024/blob/main/d07-Bridge-Repair.pl
Yes, the person briefly changed their username and then left the site (disowning their comments). There are 2 people with "inactive-user" comments in the thread that simply flounced off to greener pastures.
day 6
part 2
I also brute-forced this. I figured there's a bit optimization to be done if you "draw a line" to the next obstacle instead of going step by step, and also maybe exclude some areas, but in the end I just set an exit value to break if the number of steps exceeded a certain value and say that was a loop. Took almost 20m but a star is a star.
update I only added obstructions in the original path, which cut the time down to 5 minutes or so.
An update, a user stated, "with all love and respect": "people will not starting hating Brave but they will start to hate the mod who blocked Brave".
2 hours later they'd removed their account.
Day 5 - Print Queue
day 5
urgh this took me much longer than it should have... part 1 was easy enough but then I got tied up in knots with part 2. Finally I just sorto-bogo-sorted it all into shape
Perl: https://github.com/gustafe/aoc2024/blob/main/d05-Print-Queue.pl
Recheck array size: 98
All rechecks passed after 5938 passes
Duration: 00h00m00s (634.007 ms)
I had a lot of trouble because my input was truncated, despite the site warning me about that. Did I listen? I did not.
edit
day 9 discussion
Principal Skinner moment
"Did I miscopy the input?"
"No, it is my algorithm that is wrong"
kinda satisfying to figure out I was correct all along.
Part 2 is not as fast as I'd like (14s), but faster than it was. People on reddit are wittering on about search trees, me I just sling Perl hashrefs around
https://github.com/gustafe/aoc2024/blob/main/d09-Disk-Fragmenter.pl