Skip to content

Commit dd04255

Browse files
committed
associateBy
1 parent e569320 commit dd04255

File tree

1 file changed

+2
-2
lines changed
  • src/main/kotlin/me/peckb/aoc/_2025/calendar/day11

1 file changed

+2
-2
lines changed

src/main/kotlin/me/peckb/aoc/_2025/calendar/day11/Day11.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ class Day11 @Inject constructor(
77
private val generatorFactory: InputGeneratorFactory,
88
) {
99
fun partOne(filename: String) = generatorFactory.forFile(filename).readAs(::server) { input ->
10-
val serverMap = input.plus(Server("out")).map { it.id to it }.toMap()
10+
val serverMap = input.plus(Server("out")).associateBy { it.id }
1111

1212
countAllPaths(serverMap, serverMap["you"]!!)
1313
}
1414

1515
fun partTwo(filename: String) = generatorFactory.forFile(filename).readAs(::server) { input ->
16-
val serverMap = input.plus(Server("out")).map { it.id to it }.toMap()
16+
val serverMap = input.plus(Server("out")).associateBy { it.id }
1717

1818
countAllPaths(
1919
serverMap = serverMap,

0 commit comments

Comments
 (0)