day 4, easy

This commit is contained in:
setop 2022-12-04 10:25:08 +01:00
parent c8c36a069e
commit 3f67d3091d
2 changed files with 6 additions and 0 deletions

3
d04/part1.awk Normal file
View File

@ -0,0 +1,3 @@
# awk -F ',|-' -f part1.awk input
($3>=$1 && $4<=$2) || ($1>=$3 && $2<=$4) {n++}
END {print n}

3
d04/part2.awk Normal file
View File

@ -0,0 +1,3 @@
# awk -F ',|-' -f part2.awk input
$3>$2 || $1 > $4 {n++}
END {print NR-n}