1
0
Fork 0

day(05): switch to constant

Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
Matej Focko 2021-12-06 10:34:59 +01:00
parent 67a18e2687
commit 1f6867dc98

View file

@ -48,7 +48,7 @@ fun readVector(input: String): Vector {
} }
fun findOverlaps(input: List<Vector>): Int { fun findOverlaps(input: List<Vector>): Int {
var points: MutableMap<Point, Int> = mutableMapOf() val points: MutableMap<Point, Int> = mutableMapOf()
input input
.flatMap { it.points } .flatMap { it.points }
.forEach { points[it] = 1 + points.getOrDefault(it, 0) } .forEach { points[it] = 1 + points.getOrDefault(it, 0) }