Signed-off-by: jolheiser <john.olheiser@gmail.com>
main
jolheiser 2022-12-01 16:56:19 -06:00
commit ee63647b0a
Signed by: jolheiser
GPG Key ID: B853ADA5DA7BBF7A
2 changed files with 2250 additions and 0 deletions

2243
input/day1.txt 100644

File diff suppressed because it is too large Load Diff

7
src/day1.nu 100644
View File

@ -0,0 +1,7 @@
let input = (open ../input/day1.txt | lines)
let inputs = ($input | split list "" | each { |it| $it | into int })
let sums = ($inputs | each { |it| $it | math sum })
let ordered = ($sums | sort | reverse)
$ordered | first 1
$ordered | first 3 | math sum