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

11 lines
193 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
/(?<=(.).)(?<=(.).{138})A(?=.{138}(.))(?=.(.))/g
' |
grep -Eo '(SM|MS){2}' |
wc -l