AoC 2025: Day 12

Main thread for Day 12 of the 2025 advent of code. Feel free to discuss the challenge and ask questions. If particular discussions become large, we can break them off into new threads.

Notice that Advent of Code has changed it’s schedule and there will only be 12 days of puzzles this year.

Some Rules:

  1. Please try to keep spoilers within spoiler tags. This is done by typing [spoiler]text to be blurred[\spoiler]. If you have longer sections you can also use the [details=“Title”] tags. If you use the new WYSIWYG editor, remember to close the details section, as it is opened by default. This is an issue (feature?) of the newest discourse updates. If you use markdown, then you can remove the “open" parameter (not in by default unless you use the WYSIWYG editor)
  2. Have Fun

Day 12 Challenge

Templates:

Resources:

No Zig solution from me today…

I did it in TypeScript first lol. I coded an entire depth-first search solution, using bit masks to quickly test every shape/rotation etc. I was able to grind through a few inputs. Only then did I realise it would be impossible. Once I figured out how to skip the impossible regions the answer was quite amusing…

I won’t bother writing a parser in Zig since the final answer is so trivial

Anyway, been fun seeing all the Zig solutions this year. Thanks for sharing!

Can you clarify what you mean by “amusing”, @dbushell ? I have seen references to a joke in the Reddit thread for the day, but I didn’t get it… My solution was also very short and simply used a heuristic to see if each region had at least 10% more space that what would be needed by all the required shapes for the region – of course it would fail for many real-world cases, but it worked for my data the very first time.