diff --git a/src/main/kotlin/no/rodland/advent_2024/Day09.kt b/src/main/kotlin/no/rodland/advent_2024/Day09.kt index 9b9ad45..9cf0bb9 100644 --- a/src/main/kotlin/no/rodland/advent_2024/Day09.kt +++ b/src/main/kotlin/no/rodland/advent_2024/Day09.kt @@ -5,11 +5,14 @@ import no.rodland.advent.Day // template generated: 09/12/2024 // Fredrik Rødland 2024 -class Day09(val input: List) : Day> { +class Day09(val input: List) : Day, List>> { private val parsed = input.parse() + private val files = parsed.first + private val space = parsed.second override fun partOne(): Long { + parsed return 2 } @@ -17,10 +20,11 @@ class Day09(val input: List) : Day> { return 2 } - override fun List.parse(): List { - return map { line -> - line - } + override fun List.parse(): Pair, List> { + return first() + .map { c -> c.digitToInt() } + .chunked(2) { it.first() to it.last() } + .unzip() } override val day = "09".toInt()