Advent of C++ 2025

December 7, 2025 · View on GitHub

It's that time of the year again! The goal is to get through all the 12 days this time.

DaysPart APart B
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7

Note: ★ = completed the solution ☆ = had to get help

Setup

make 
DYLD_LIBRARY_PATH=./bin/shared ./bin/main <day00> </path/to/input>

I decided to over-engineer how each solution is loaded and built; essentially each solution is built as a .so file in ./bin/shared, then main code uses dlopen to dynamically load and execute the function.

Logs

Day 2

I took a short break from AoC, slept on Day 2 and got it working eventually. Honestly, Day 2 was def easier than Day 1, the main lesson learnt here was using the appropriate type conversion functions, given the input.

So I was reading the input into a string buffer, and then casting it to a size_t through atoi(buffer), this worked for the sample, but undershot for the actual input. I then tried using strtoul and that OVERSHOT when I cast it to a size_t. Finally what worked was std::stoul(). It is truly a mystery where these functions are named so cryptically. Onto day 3!

Day 6

It's the second time in AoC where I spent HOURS debugging an issue, only to realize it was fixed by just changing the numeric declarations from auto (which defaults to int) to size_t to fix the big ass numbers found in the AoC inputs

Day 7

Day 7 was PRETTY difficult, had to loop up the memoization technique on youtube to make it work (the bruteforce solution didn't even work after 20 mins, and trust me, I TRIED.)

Previous Attempts