Skip to content

Commit 42504dd

Browse files
committed
Clean up 2025 day 7 a bit
1 parent 1d9cb46 commit 42504dd

File tree

1 file changed

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

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ object Day7 {
2626

2727
BFS.traverse(graphTraversal)
2828
.nodes
29-
.count(pos => grid(pos) == '^')
29+
.count(grid(_) == '^')
3030
}
3131

3232
def countTimelines(grid: Grid[Char]): Long = {
@@ -48,7 +48,8 @@ object Day7 {
4848
}
4949
}
5050

51-
helper(0, Map(grid.posOf('S').x -> 1))
51+
val startPos = grid.posOf('S')
52+
helper(startPos.y, Map(startPos.x -> 1))
5253
}
5354

5455
def parseGrid(input: String): Grid[Char] = input.linesIterator.map(_.toVector).toVector

0 commit comments

Comments
 (0)