Last active
September 26, 2020 13:09
-
-
Save windmaomao/71bfa52e79cfbb6ff0571001eacf1985 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// aoc2015-d2-part1.kt | |
val paper = { l: Int, w: Int, h: Int -> | |
(l * w + w * h + h * l) * 2 + | |
l * w * h / maxOf(l, w, h) | |
} | |
fun part1(list: List<Box>) = list | |
.map { (l, w, h) -> paper(l, w, h) } | |
.sum() | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment