#day09 — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #day09, aggregated by home.social.
-
CW: Advent of Code 2025 day 9 solution
This one was really hard for me. Part 1 wasn't bad at all; I could basically use the entirety of what I did yesterday for it.
Part 2 was really hard. At first, I tried actually building a
HashSetof all the red and green tiles, and then aHashSetof all the areas for each pair, and checking them against each other. Needless to say, that wouldn't work. Building the tileHashSetalone would have eaten up more memory than I have on my computer, and I should have realized that immediately looking at my answer to part 1 (which was an area of over 4 billion tiles). I thought that checking a line of green tiles through the area wouldn't necessarily work, because a malicious input could make that not work (two immediate right or left turns could make a pair of adjacent green tile lines that would still work), but it turns out that it works fine for my input. Probably all inputs.It works. I don't feel totally satisfied with the solution, but it works.
I think a more robust solution could be to trace the outline and fill it with square area units, then for each area to test (ordered from largest to smallest), repeatedly cut area out of it with the green tile squares. If all overlapping areas are tested and there are still un-cut squares, the area is invalid; move on to the next. If the area is cut completely to nothing, then it is the best area. I'm not going to implement this, because it sounds like a total fiddly pain, but I would be interested in seeing somebody else's solution along these lines.
#AdventOfCode #AdventOfCode2025 #AdventOfCode2025Day9 #AdventOfCode2025Day09 #Day9 #Day09 #Rust #RustLang #Programming #CodingChallenges
-
Went for a walk around the Oudegracht while D was having Spanish class. I did not want to, & of course I felt better once I was actually going, but ugh. Motivation is hard. I took quite a few photos along the way & I really like this one for some reason. Not sure what the custom of putting them on the wall in front of your house is all about, but I saw three houses on one street with pairs hung up like this. #Day09 #365happydays2023 #walking #wandeling #clogs #klompen #utrecht #photography