about summary refs log tree commit diff
path: root/day06.clj
blob: b7f8eca313e753faf611d89a420ad31161e7e6f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
(def data
  (clojure.string/split (slurp "day06") #"\n\n"))

(->> data
     (map #(->> %
                (remove #{\newline})
                set
                count))
     (apply +)) ; => 6612

(->> data
     (map #(->> %
                clojure.string/split-lines
                (map set)
                (reduce clojure.set/intersection)
                count))
     (apply +)) ; => 3268