This commit is contained in:
zuckerberg
2022-12-02 19:07:34 -07:00
commit a3766a0666
7 changed files with 4833 additions and 0 deletions

2238
1/input Normal file

File diff suppressed because it is too large Load Diff

13
1/solution.nix Normal file
View File

@@ -0,0 +1,13 @@
with import ../utilities.nix;
let
input = readFile ./input;
elfCalories = map (grp: map toInt (splitString "\n" grp)) (splitString "\n\n" input);
totalsPerElf = map sum elfCalories;
part1 = maxList totalsPerElf;
part2 = sum (topOfList (sortList totalsPerElf) 3);
in {
inherit part1;
inherit part2;
}