Skip to content

Commit

Permalink
2024 - Day 09 - parse
Browse files Browse the repository at this point in the history
  • Loading branch information
fmmr committed Dec 9, 2024
1 parent f088c42 commit 80aa559
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/main/kotlin/no/rodland/advent_2024/Day09.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,26 @@ import no.rodland.advent.Day
// template generated: 09/12/2024
// Fredrik Rødland 2024

class Day09(val input: List<String>) : Day<Long, Long, List<String>> {
class Day09(val input: List<String>) : Day<Long, Long, Pair<List<Int>, List<Int>>> {

private val parsed = input.parse()
private val files = parsed.first
private val space = parsed.second

override fun partOne(): Long {
parsed
return 2
}

override fun partTwo(): Long {
return 2
}

override fun List<String>.parse(): List<String> {
return map { line ->
line
}
override fun List<String>.parse(): Pair<List<Int>, List<Int>> {
return first()
.map { c -> c.digitToInt() }
.chunked(2) { it.first() to it.last() }
.unzip()
}

override val day = "09".toInt()
Expand Down

0 comments on commit 80aa559

Please sign in to comment.