-
-
Save KennyMonster/ef878c0a789cebe2df3e572a11803f01 to your computer and use it in GitHub Desktop.
AOC 2020 Day 6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns day-6 | |
(:require [clojure.string :as str] | |
[clojure.set :refer [union intersection]])) | |
(def data (-> (slurp "input/day_6.txt") | |
(str/split #"\n\n"))) | |
(defn yes-count [s set-op] | |
(count (apply set-op (map set (str/split-lines s))))) | |
(comment | |
(reduce + (map #(yes-count % union) data)) | |
(reduce + (map #(yes-count % intersection) data))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment