5GEE4HIVDIGRTHT4TT4HQD6TNYESYWDZZACOCVMSAUWOT42TA5EQC
(ns six.core
(:require [clojure.java.io :as io]
[clojure.string :as str]
[clojure.set :as set]))
(def data (map str/split-lines (-> "input.dat"
io/resource
slurp
(str/split #"\n\n"))))
(def group-sets (map #(set (apply concat %)) data))
(def part-one (reduce + (map count group-sets)))
(defn make-individual-set [answers]
(set (seq answers)))
(def individual-sets (map #(map make-individual-set %) data))
(def intersections (map #(apply set/intersection %) individual-sets))
(def part-two (reduce + (map count intersections)))
(defproject six "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "https://www.eclipse.org/legal/epl-2.0/"}
:dependencies [[org.clojure/clojure "1.10.1"]]
:repl-options {:init-ns six.core})