aoc2022/d04/part1.awk

4 lines
95 B
Awk

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