1
0

Prepare for other years

This commit is contained in:
2020-12-30 18:01:52 +01:00
parent 522618d106
commit 4a90257257
81 changed files with 277 additions and 253 deletions
+32
View File
@@ -0,0 +1,32 @@
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
@Day(1)
class Day01(@Lines input: Input<IntArray>) {
private val items = input.value
fun part1(): Int? {
items.forEach { a ->
items.forEach { b ->
if (a + b == 2020) return a * b
}
}
return null
}
fun part2(): Int? {
items.forEach { a ->
items.forEach { b ->
items.forEach { c ->
if (a + b + c == 2020) return a * b * c
}
}
}
return null
}
}