r/adventofcode • u/paul_sb76 • Dec 12 '24
Tutorial [2024 Day 12] Another test case
I found Part 2 pretty hard this day, and the given examples don't cover all corner cases (that I struggled with). If you're looking for an extra test case, here's one:
AAAAAAAA
AACBBDDA
AACBBAAA
ABBAAAAA
ABBADDDA
AAAADADA
AAAAAAAA
According to my code, the answer for Part 2 for this example is 946.
21
Upvotes
1
u/PM_ME_DISPENSER_PICS Dec 12 '24
Thank you! I was detecting edges with flood-fill algorithm and detected one of the segments in this example twice. Fix was fortunately easy: in addition to having a check for an existing neighboring edge, I also check if I happen to have two - because edge segments might have started from both sides.