Last active
December 14, 2020 15:51
-
-
Save leetwinski/faeffdd93f0d45408c84284a8f3d842f to your computer and use it in GitHub Desktop.
Revisions
-
leetwinski revised this gist
Dec 14, 2020 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,8 @@ ;; part2 (apply + (map #(let [g-size (inc (count (filter #{\newline} %)))] (->> (frequencies %) vals (filter #{g-size}) count)) data-6)) -
leetwinski created this gist
Dec 14, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ (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} %)))] (count (filter (comp #{g-size} second) (frequencies %)))) data-6))