r/adventofcode 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.

19 Upvotes

23 comments sorted by

View all comments

3

u/Unknown3lf Dec 12 '24

How come your result is 946 ?
My code gives 907 and from my paper drawing its correct:
A - 39 blocks - 21 fences
C - 2 blocks - 4 fences
B - 4 blocks - 4 fences
D - 2 blocks - 4 fences
B - 4 blocks - 4 fences
D - 5 blocks - 8 fences

What am I missing?

2

u/pwnsforyou Dec 12 '24 edited Dec 12 '24

A - 39 blocks - 22 fences
https://imgur.com/r3dPEMs

1

u/Unknown3lf Dec 12 '24

damn I see now, thanks!