This commit is contained in:
yosh 2022-12-01 12:38:57 -05:00
commit 35e42e74ac
3 changed files with 2273 additions and 0 deletions

18
01.awk Normal file
View File

@ -0,0 +1,18 @@
BEGIN {
RS = "\n\n"; FS = "\n"
TOP = 3
toptot = 0
}
{
tot = 0
for (i = 1; i <= NF; i++)
tot += $i
cal[FNR] = tot
}
END {
asort(cal, cal, "@val_num_desc")
for (i = 1; i <=TOP; i++)
toptot += cal[i]
print "elf with most calories has " cal[1] " calories"
print "sum of top 3: " toptot
}

2249
01_input Normal file

File diff suppressed because it is too large Load Diff

6
README.md Normal file
View File

@ -0,0 +1,6 @@
my advent of code 2022 solutions
mainly going to be using shell + posix-defined utilities, probably
## Days
1. awk (uses features exclusive to GNU's implementation, gawk)