mirror of
https://github.com/Ajetski/advent-of-code.git
synced 2025-09-30 07:23:18 -09:00
golf
This commit is contained in:
parent
c6517a9c3b
commit
720d668620
@ -5,13 +5,13 @@
|
||||
|
||||
(def input (get-puzzle-input 6))
|
||||
|
||||
(defn solve [num-str-lists]
|
||||
(defn solve [num-str-lists] ; takes a list of list of nums-string representing time and distance
|
||||
(->> (map (partial map #(Long/parseLong %)) num-str-lists)
|
||||
(apply zipmap)
|
||||
(map (fn [[ms record]] (->> (range 1 ms)
|
||||
(map #(* % (- ms %)))
|
||||
(filter #(> % record))
|
||||
(count))))
|
||||
count)))
|
||||
(reduce *)))
|
||||
|
||||
;; part 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user