franz newline

This commit is contained in:
Adam Jeniski 2025-12-19 08:52:47 -10:00
parent f88a28cad2
commit d55ca4c019

View File

@ -7,14 +7,11 @@
(partial re-seq #"[a-z]{3}"))) (partial re-seq #"[a-z]{3}")))
(into {}))) (into {})))
(def count-paths (def count-paths (memoize (fn [start target]
(memoize (let [edges (input start)]
(fn [start target] (if (contains? edges target)
(let [edges (input start)] 1
(if (contains? edges target) (apply + (map #(count-paths % target) edges)))))))
1
(apply + (map #(count-paths % target) edges)))))))
;; part 1 ;; part 1
(count-paths "you" "out") (count-paths "you" "out")