1
0
This commit is contained in:
Hubert Van De Walle 2021-12-10 19:59:36 +01:00
parent 57f4a97627
commit b5e8ea0a3b

View File

@ -50,12 +50,7 @@ class Day10 : BaseDay() {
stack.add(char)
}
}
var score = 0L
stack.asReversed().forEach {
score *= 5
score += points[it]!!
}
score
stack.foldRight(0L) { char, score -> score * 5 + points[char]!! }
}.sorted().let { it[it.size / 2] }
}
}