This commit is contained in:
2024-12-03 15:31:10 +08:00
parent b2f9cf2589
commit d9616826c1
3 changed files with 38 additions and 0 deletions

7
2024/day-3/solution-1.sh Normal file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
grep -Eo 'mul\([0-9]+,[0-9]+\)' input |
sed -E 's/^mul\(([0-9]+),([0-9]+)\)/\1*\2/g' |
bc |
paste -s -d "+" |
bc