Update things
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user