1
0

Update things

This commit is contained in:
2021-12-01 19:32:38 +01:00
parent ccfcf5a259
commit 322f8eb45a
53 changed files with 156 additions and 239 deletions
+3 -4
View File
@@ -1,17 +1,16 @@
package be.vandewalleh.aoc.days
import be.vandewalleh.aoc.utils.input.Day
import be.vandewalleh.aoc.utils.input.Input
import be.vandewalleh.aoc.utils.input.Lines
import org.eclipse.collections.api.list.primitive.MutableIntList
import org.eclipse.collections.impl.factory.primitive.IntLists
import org.eclipse.collections.impl.factory.primitive.IntLongMaps
@Day(10)
class Day10(@Lines val input: Input<IntArray>) {
class Day10(@Lines val input: IntArray) {
fun part1(): Int {
val sorted = IntLists.mutable.of(0, *input.value).apply {
val sorted = IntLists.mutable.of(0, *input).apply {
sortThis()
add(last + 3)
}.toArray().toList()
@@ -28,7 +27,7 @@ class Day10(@Lines val input: Input<IntArray>) {
}
fun part2(): Long {
val sorted: MutableIntList = IntLists.mutable.of(*input.value).apply { sortThis() }
val sorted: MutableIntList = IntLists.mutable.of(*input).apply { sortThis() }
val map = IntLongMaps.mutable.empty().apply {
put(0, 1L)