aoc2021/d08/d08_1.awk

4 lines
86 B
Awk

BEGIN{FS=" |"}
{for (i=11;i<=NF;i++){A[length($i)]++}}
END{print A[2]+A[3]+A[4]+A[7]}