diff options
author | Leah Neukirchen <leah@vuxu.org> | 2020-12-02 13:34:36 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2020-12-02 13:34:36 +0100 |
commit | 4fcb892b97f7bbdba4c2a873e4493a00722ef40e (patch) | |
tree | 9a4ef2178491784c57aebc7046eedcad1ebc80cc /day01.clj | |
parent | 68f50ebf838f4c1e2764d65db5ce606cf101eaf3 (diff) | |
download | adventofcode2020-4fcb892b97f7bbdba4c2a873e4493a00722ef40e.tar.gz adventofcode2020-4fcb892b97f7bbdba4c2a873e4493a00722ef40e.tar.xz adventofcode2020-4fcb892b97f7bbdba4c2a873e4493a00722ef40e.zip |
day01
Diffstat (limited to 'day01.clj')
-rw-r--r-- | day01.clj | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/day01.clj b/day01.clj new file mode 100644 index 0000000..d054ac7 --- /dev/null +++ b/day01.clj @@ -0,0 +1,15 @@ +(def data + (->> (slurp "day01") + (clojure.string/split-lines) + (map #(Integer/parseInt %)))) + +(first (for [a data + b data + :when (= 2020 (+ a b))] + (* a b))) ; => 805731 + +(first (for [a data + b data + c data + :when (= 2020 (+ a b c))] + (* a b c))) ; => 192684960 |