diff options
| author | June McEnroe <june@causal.agency> | 2020-12-01 00:15:05 -0500 |
|---|---|---|
| committer | June McEnroe <june@causal.agency> | 2020-12-01 00:15:05 -0500 |
| commit | 90da9dc9fd359683e0c57be114e967a9ef8c0696 (patch) | |
| tree | d61ade7f2daa501e8492f596fa4825520d125c42 /2020/day01-1.sh | |
| parent | Solve day 10 part 2 (diff) | |
| download | aoc-90da9dc9fd359683e0c57be114e967a9ef8c0696.tar.gz aoc-90da9dc9fd359683e0c57be114e967a9ef8c0696.zip | |
Solve day 1 part 1
Diffstat (limited to '2020/day01-1.sh')
| -rw-r--r-- | 2020/day01-1.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/2020/day01-1.sh b/2020/day01-1.sh new file mode 100644 index 0000000..030d523 --- /dev/null +++ b/2020/day01-1.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -eu +entries=$(cat) +for i in $entries; do + for j in $entries; do + if [ $((i+j)) -eq 2020 ]; then + echo $((i*j)) + exit + fi + done +done |