about summary refs log tree commit diff
path: root/day06.clj
diff options
context:
space:
mode:
Diffstat (limited to 'day06.clj')
-rw-r--r--day06.clj17
1 files changed, 17 insertions, 0 deletions
diff --git a/day06.clj b/day06.clj
new file mode 100644
index 0000000..b7f8eca
--- /dev/null
+++ b/day06.clj
@@ -0,0 +1,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