summaryrefslogtreecommitdiff
path: root/2020/day1
diff options
context:
space:
mode:
Diffstat (limited to '2020/day1')
-rwxr-xr-x2020/day112
1 files changed, 12 insertions, 0 deletions
diff --git a/2020/day1 b/2020/day1
new file mode 100755
index 0000000..30e730e
--- /dev/null
+++ b/2020/day1
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -- $(cat)
+
+for a1; do
+ for a2; do
+ for a3; do
+ [ $(( a1 + a2 + a3 )) -eq 2020 ] && break 3
+ done
+ done
+done
+echo $(( a1 * a2 * a3 ))