about summary refs log tree commit diff
path: root/day01.clj
blob: d054ac76f8f4154fd7d4b7c19d820b28c5c59aac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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