Skip to content

Commit a5e4027

Browse files
committed
fix: debug day 12 part 2
1 parent 0a6f4ed commit a5e4027

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

src/main/java/com/adventofcode/flashk/day12/GardenGroups.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ private void countVerticalSides() {
197197
GardenPlot topRightPlot = getUpRightPlot(row,col).orElse(noPlot());
198198

199199
if(checkAdjacents(rightPlot, topPlot, currentPlot)
200-
|| checkAdjacentsAndDiagonal(rightPlot, topPlot, topRightPlot, currentPlot)) {
200+
|| checkAdjacentsAndDiagonalV(topPlot, rightPlot, topRightPlot, currentPlot)) {
201201
addSides(currentPlot);
202202
}
203203

src/test/java/com/adventofcode/flashk/day12/Day12Test.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,8 @@ public void testSolvePart2Input() {
197197
// Read input file
198198
char[][] inputs = Input.read2DCharArray(INPUT_FOLDER, TestFilename.INPUT_FILE);
199199
GardenGroups gardenGroups = new GardenGroups(inputs);
200-
System.out.println("Solution: "+gardenGroups.solveB());
201200

202-
// 875718 -> Too high
203-
// 871792 -> Too high (tras ajustar lógica para los convexos internos.
204-
// 868050 -> Too low (con el nuevo algoritmo
205-
assertEquals(0L,0L);
201+
assertEquals(870202L,gardenGroups.solveB());
206202

207203
}
208204

src/test/resources/inputs

0 commit comments

Comments
 (0)