There was an error while loading. Please reload this page.
1 parent 35fe367 commit 2c506eeCopy full SHA for 2c506ee
src/pl/shockah/aoc/y2021/Day1.kt
@@ -10,7 +10,7 @@ class Day1: AdventTask<List<Int>, Int, Int>(2021, 1) {
10
}
11
12
private fun task(input: List<Int>): Int {
13
-return input.indices.toList().dropLast(1).count { input[it] < input[it + 1] }
+return input.windowed(2).count { (a, b) -> a < b }
14
15
16
override fun part1(input: List<Int>): Int {
0 commit comments