adventofcode2023/day01/sol.awk

3 lines
90 B
Awk

{ gsub("[^0-9]", " "); gsub("[0-9]", "& "); n = $1 $NF; T += n; print n }
END { print T }