advent2021/one_second.awk

4 lines
85 B
Awk
Executable File

#!/usr/bin/awk -f
{a[NR]=$1} END{for(i=4;i<=NR;i++) if(a[i] > a[i-3]) n++; print n}