diff options
author | June McEnroe <june@causal.agency> | 2020-12-01 00:17:47 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-12-01 00:17:55 -0500 |
commit | 7fb36ba69063f2152e8b581ce23c9463ce41abc0 (patch) | |
tree | 32002aa330c063f4975642b711262da695606d5f /2020 | |
parent | Solve day 1 part 1 (diff) | |
download | aoc-7fb36ba69063f2152e8b581ce23c9463ce41abc0.tar.gz aoc-7fb36ba69063f2152e8b581ce23c9463ce41abc0.zip |
Solve day 1 part 2
41.66 real 39.15 user 1.98 sys
Diffstat (limited to '2020')
-rw-r--r-- | 2020/day01-2.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/2020/day01-2.sh b/2020/day01-2.sh new file mode 100644 index 0000000..6f26437 --- /dev/null +++ b/2020/day01-2.sh @@ -0,0 +1,13 @@ +#!/bin/sh +set -eu +entries=$(cat) +for i in $entries; do + for j in $entries; do + for k in $entries; do + if [ $((i+j+k)) -eq 2020 ]; then + echo $((i*j*k)) + exit + fi + done + done +done |