Skip to content

Commit b095fbb

Browse files
committed
Improve sanity check in naive solution in 2025 day 12
1 parent 6571b02 commit b095fbb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main/scala/eu/sim642/adventofcode2025/Day12.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,12 @@ object Day12 {
4141
if (shapeI < 0)
4242
true // nothing more to fit
4343
else {
44-
//val newShapeCounts = shapeCounts.updated(shapeI, shapeCounts(shapeI) - 1)
45-
//val shape = shapes(shapeI)
4644
if (poss.isEmpty)
4745
false
4846
else {
4947
val pos = poss.head
5048
//print(s"$indent $pos")
51-
val todo = region.size.x * region.size.y - pos.x * region.size.y - pos.y
49+
val todo = region.size.x * region.size.y - pos.x * region.size.y - pos.y - (if (pos.x == shapeOrientationBox.max.x) pos.y * 2 else 0)
5250
val areaLowerBound = // only counting the #-s in shapes
5351
shapes
5452
.map(_.countGrid(identity))

0 commit comments

Comments
 (0)