summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-12-01 00:15:05 -0500
committerJune McEnroe <june@causal.agency>2020-12-01 00:15:05 -0500
commit90da9dc9fd359683e0c57be114e967a9ef8c0696 (patch)
treed61ade7f2daa501e8492f596fa4825520d125c42
parentSolve day 10 part 2 (diff)
downloadaoc-90da9dc9fd359683e0c57be114e967a9ef8c0696.tar.gz
aoc-90da9dc9fd359683e0c57be114e967a9ef8c0696.zip
Solve day 1 part 1
-rw-r--r--2020/day01-1.sh11
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