14_2 solves part 1 and 2

This commit is contained in:
sejo 2021-12-14 00:19:39 -06:00
parent d39dc8b14b
commit 12cc89de34
1 changed files with 10 additions and 10 deletions

View File

@ -30,15 +30,15 @@ END{
}
delete paircount
for(p in newpaircount) paircount[p] = newpaircount[p]
}
min = 999999999999
max = 0
for(c in countl){
count[c] = countl[c]>countr[c] ? countl[c] : countr[c]
if(count[c]>max) max=count[c]
if(count[c]<min) min=count[c]
}
print max, min
print max-min
min = 999999999999
max = 0
for(c in countl){
count[c] = countl[c]>countr[c] ? countl[c] : countr[c]
if(count[c]>max) max=count[c]
if(count[c]<min) min=count[c]
}
if(s==10) print "part 1: ", max-min
if(s==40) print "part 2: ", max-min
}
}