Created
September 19, 2020 13:42
-
-
Save windmaomao/d0834c9993e528faa9f80f5468d9e8d9 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-day2-part.kt | |
fun part( | |
list: List<Box>, | |
fn: (Int, Int, Int) -> Int | |
) = list | |
.map { (l, w, h) -> fn(l, w, h) } | |
.sum() | |
fun part1(list: List<Box>) = part(list, paper) | |
fun part2(list: List<Box>) = part(list, paper2) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment