Unable to load image

rDrama Advent of Code Day 22: Baby It's Cold Outside Edition

Summary for those just joining us:

Advent of Code is an annual Christmas themed coding challenge that runs from December 1st until christmas. Each day the coding problems get progressively harder. We have a leaderboard and pretty good turnout, so feel free to hop in at any time and show your stuff!

Whether you have a single line monstrosity or a beautiful phone book sized stack of OOP code, you can export it in a nice little image for sharing at https://carbon.vercel.app

What did you think about today's problem?

https://adventofcode.com/2023

Our Code is 2416137-393b284c (No need to share your profile, you have the option to join anonymously if you don't want us to see your github)

31
Jump in the discussion.

No email address required.

This is a cool problem that he could have done a lot with. I'd have liked to see him go full tetris and destroy entire levels or have you score based on how full a level is.

My code is disgusting and I think I got lucky to get a working P1 relatively quickly, because I didn't fancy bug hunting.

I changed my input data structure a few times before settling on a dict of coord -> brick_id for each individual 1x1x1 cube. It makes the code a bit cleaner but still takes 12 mins for part 2. It's day 22 and I'm sick of AoC so I won't be optimising it.

EDIT: on second thoughts I'm surprised that I was able to solve this by moving each brick individually. For day 22 I'd have expected part 2 to not work at all by brute force. The tree solution is much prettier and more efficient

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.