diff --git a/d04/part1.awk b/d04/part1.awk new file mode 100644 index 0000000..4f139bc --- /dev/null +++ b/d04/part1.awk @@ -0,0 +1,3 @@ +# awk -F ',|-' -f part1.awk input +($3>=$1 && $4<=$2) || ($1>=$3 && $2<=$4) {n++} +END {print n} diff --git a/d04/part2.awk b/d04/part2.awk new file mode 100644 index 0000000..ce52f97 --- /dev/null +++ b/d04/part2.awk @@ -0,0 +1,3 @@ +# awk -F ',|-' -f part2.awk input +$3>$2 || $1 > $4 {n++} +END {print NR-n}