Day 4
This commit is contained in:
10
2024/day-4/solution-2.sh
Normal file
10
2024/day-4/solution-2.sh
Normal 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
|
Reference in New Issue
Block a user