This commit is contained in:
2024-12-04 20:46:24 +08:00
parent d9616826c1
commit 486afb7a1b
3 changed files with 259 additions and 0 deletions

10
2024/day-4/solution-2.sh Normal file
View File

@ -0,0 +1,10 @@
#!/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