summary refs log tree commit diff homepage
diff options
context:
space:
mode:
-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