From 7fb36ba69063f2152e8b581ce23c9463ce41abc0 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Tue, 1 Dec 2020 00:17:47 -0500 Subject: Solve day 1 part 2 41.66 real 39.15 user 1.98 sys --- 2020/day01-2.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 2020/day01-2.sh (limited to '2020') 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 -- cgit 1.4.1