From 6036beda8ceae3eb9d2906b2096c7b7c6a1d03ec Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Tue, 1 Dec 2020 00:15:05 -0500 Subject: Solve day 1 part 1 --- 2020/day01-1.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 2020/day01-1.sh 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 -- cgit 1.4.1