Skip to content

Commit febab04

Browse files
committed
Clean up 2025 day 8 part 2
1 parent 5ea88db commit febab04

File tree

1 file changed

+2
-3
lines changed
  • src/main/scala/eu/sim642/adventofcode2025

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,10 @@ object Day8 {
4646
.product
4747
}
4848

49-
// TODO: deduplicate
5049
def multiplyLastXs(junctionBoxes: Seq[Pos3]): Int = {
5150
val closestPairs = iterateClosestPairs(junctionBoxes)
52-
val lastPair = Kruskal.iterateEdges(junctionBoxes, closestPairs).last
53-
lastPair._1.x * lastPair._2.x
51+
val (p1, p2) = Kruskal.iterateEdges(junctionBoxes, closestPairs).last
52+
p1.x * p2.x
5453
}
5554

5655
def parseJunctionBox(s: String): Pos3 = s match {

0 commit comments

Comments
 (0)