Skip to content

Instantly share code, notes, and snippets.

@leetwinski
Last active December 14, 2020 15:51
Show Gist options
  • Save leetwinski/faeffdd93f0d45408c84284a8f3d842f to your computer and use it in GitHub Desktop.
Save leetwinski/faeffdd93f0d45408c84284a8f3d842f to your computer and use it in GitHub Desktop.
advent of code 2020 / 6
(def data-6 (clojure.string/split in-6 #"\n\n"))
;; part1
(apply + (map #(count (disj (set %) \newline)) data-6))
;; part2
(apply + (map #(let [g-size (inc (count (filter #{\newline} %)))]
(->> (frequencies %)
vals
(filter #{g-size})
count))
data-6))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment