Files
advent-of-code/2024/day-4/solution-2.sh

10 lines
173 B
Bash
Raw Normal View History

2024-12-04 20:46:24 +08:00
#!/usr/bin/env bash
paste -s -d '' input.txt |
perl -lne '
print "$1$4$2$3"
while
2024-12-04 22:15:25 +08:00
/(?<=(.).(.).{138})A(?=.{138}(.).(.))/g
2024-12-04 20:46:24 +08:00
' |
2024-12-04 22:15:25 +08:00
grep -Ec '(SM|MS){2}'