Skip to content

Commit 8dcfec8

Browse files
committed
Day 6: part 1 cleanup
1 parent b548eab commit 8dcfec8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/scala/Day06.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,6 @@ object Day06:
119119
} yield Lab(cells, Guard(guardPos, direction))
120120

121121
def findGuard(cells: List[List[Cell]]): Option[(Pos, Direction)] =
122-
cells
123-
.map(_.zipWithIndex)
124-
.zipWithIndex
125-
.map((row, rowIndex) => row.map((cell, colIndex) => (Pos(rowIndex, colIndex), cell)))
122+
cells.zipWithIndex
123+
.map((row, rowIndex) => row.zipWithIndex.map((cell, colIndex) => (Pos(rowIndex, colIndex), cell)))
126124
.collectFirstSome(_.collectFirst { case (pos, GuardCell(direction)) => (pos, direction) })

0 commit comments

Comments
 (0)