1
0
Fork 0

day(01): remove function body

Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
Matej Focko 2021-12-04 15:14:59 +01:00
parent 2c3be983dd
commit 4186cf4815

View file

@ -3,13 +3,8 @@ package day01
import readInputAsInts import readInputAsInts
fun main() { fun main() {
fun part1(input: List<Int>): Int { fun part1(input: List<Int>): Int = input.windowed(2).count { it[0] < it[1] }
return input.windowed(2).count { it[0] < it[1] } fun part2(input: List<Int>): Int = part1(input.windowed(3).map { it.sum() }.toList())
}
fun part2(input: List<Int>): Int {
return part1(input.windowed(3).map { it.sum() }.toList())
}
val testInput = readInputAsInts(1, "test_input") val testInput = readInputAsInts(1, "test_input")
val input = readInputAsInts(1, "input") val input = readInputAsInts(1, "input")