aoc2022/d04/part1.awk

4 lines
95 B
Awk
Raw Permalink Normal View History

2022-12-04 09:25:08 +00:00
# awk -F ',|-' -f part1.awk input
($3>=$1 && $4<=$2) || ($1>=$3 && $2<=$4) {n++}
END {print n}