Files
advent-of-code/2024/day-3/solution-1.sh

8 lines
146 B
Bash
Raw Normal View History

2024-12-03 15:31:10 +08:00
#!/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