diff --git a/src/main/kotlin/no/rodland/advent_2024/Day19.kt b/src/main/kotlin/no/rodland/advent_2024/Day19.kt index 119c73c8..7317216c 100644 --- a/src/main/kotlin/no/rodland/advent_2024/Day19.kt +++ b/src/main/kotlin/no/rodland/advent_2024/Day19.kt @@ -5,9 +5,11 @@ import no.rodland.advent.Day // template generated: 19/12/2024 // Fredrik Rødland 2024 -class Day19(val input: List) : Day> { +class Day19(val input: List) : Day, List>> { private val parsed = input.parse() + private val towels = parsed.first + private val designs = parsed.second override fun partOne(): Long { return 2 @@ -17,10 +19,11 @@ class Day19(val input: List) : Day> { return 2 } - override fun List.parse(): List { - return map { line -> - line - } + override fun List.parse(): Pair, List> { + val (towel, design) = joinToString("\n").split("\n\n") + val towels = towel.split(", ") + val designs = design.split("\n") + return towels to designs } override val day = "19".toInt()