1
0
Fork 0

day(09): remove lambda from fold

Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
Matej Focko 2021-12-09 13:25:52 +01:00
parent 1cfee94e2a
commit c4a4408505

View file

@ -51,7 +51,7 @@ fun part2(input: List<List<Int>>): Int {
} }
sizes.sortDescending() sizes.sortDescending()
return sizes.take(3).fold(1) { product, n -> n * product } return sizes.take(3).fold(1, Int::times)
} }
fun main() { fun main() {