Anyone else completed Advent of Code 2024? Some summary on my journey thru all 25 problems.
The last day 25 problem I managed to get right on the first go. I wrote code in 5 minutes and got the correct result. I was expecting big trouble.
Thank God. The problems are over.
The hardest problem for me was Day 21 part 2. I wrote a monte carlo solution for the part 1 and that solved it barely. The part had a 25 level keypads which exploded the sequences that my 16 CPU 16 GB RAM couldn't get even to 17 depth. Even a supercomputer would have failed my code. I had some mental block to write code that stores count of sequences not sequences. Then after a few days of trial and error the day 21 cracked at 10ms. The part 1 also cracked in 1 ms. The trick is to treat the code in pairs and store results with depth is cache. "<>A<A" becomes "A -> >" solve for depth 1 and store in cache. Then go higher up in tree. Almost gave up on day 21 after a few days.
Day 24 part 1 cracked after lots of efforts. Day 24 part 2 I got multiple correct wire swaps. The z was equal to x+y. Finally I produced the correct 8 wire swaps. The trick is to swap wires (by keeping the best swap in memory) then test whether z equals x+y.
A* and breadth first algorithms become handy in some problems. Halting problem was at some point.
A* - algorithm is in my opinion the most beautiful algorithm in computer science.
For chess programming point of view I didn't use alpha-beta/minimax algorithm once. However I used monte-carlo and tree search algos many times. Mostly brute force and some optimizations here and there.
I hit recursionlimit on python a few times.
Overall: Advent of code 2024 was tough but great. Enjoyed much more than writing some knight evaluation crap.
Advent Of Code 2024
Moderator: Ras
-
- Posts: 529
- Joined: Sat Mar 02, 2013 11:31 pm
-
- Posts: 1341
- Joined: Sun Jul 17, 2011 11:14 am
- Full name: Hannah Ravensloft
Re: Advent Of Code 2024
My job involves working on an A* pathfinder. It's only beautiful when you have a well-behaved problem...A* - algorithm is in my opinion the most beautiful algorithm in computer science.
tu ne cede malis, sed contra audentior ito
-
- Posts: 12157
- Joined: Thu Mar 09, 2006 12:57 am
- Location: Birmingham UK
- Full name: Graham Laight
Re: Advent Of Code 2024
Any example questions, please?
I searched for "Code 24", and here's the response:
Code 24 questions are questions that involve a code language where the word "cat" is coded as 24. For example, you might be asked to find the code for the word "rat" in the same code language.
Example questions
If "cat" is coded as 24, what is the code for "rat"?
If "little" is coded as 24, what is the code for "paris"?
If "little" is coded as 24, what is the code for "done"?
Explanation
Code 24 questions are a type of code language question that involves using a code to represent words.
Is this the kind of puzzle you've been solving?
Want to attract exceptional people? Be exceptional.
-
- Posts: 1341
- Joined: Sun Jul 17, 2011 11:14 am
- Full name: Hannah Ravensloft
Re: Advent Of Code 2024
"Advent of Code 2024", as in https://adventofcode.com/, not "Code 24".
tu ne cede malis, sed contra audentior ito
-
- Posts: 12157
- Joined: Thu Mar 09, 2006 12:57 am
- Location: Birmingham UK
- Full name: Graham Laight
Re: Advent Of Code 2024
ZirconiumX wrote: ↑Thu Jan 16, 2025 12:16 am "Advent of Code 2024", as in https://adventofcode.com/, not "Code 24".
Thank you.
Want to attract exceptional people? Be exceptional.