mirror of
https://github.com/Ajetski/advent-of-code.git
synced 2025-09-30 13:03:19 -09:00
improve naming
This commit is contained in:
parent
7396fcc6d1
commit
9ddce5f7a8
@ -40,7 +40,7 @@
|
|||||||
(map #(vector row (:start %) (:group %))
|
(map #(vector row (:start %) (:group %))
|
||||||
matches)))
|
matches)))
|
||||||
(mapcat identity)
|
(mapcat identity)
|
||||||
(map (fn touching-star [[row-idx col-idx s]]
|
(map (fn touching-stars [[row-idx col-idx s]]
|
||||||
(let [length (count s)]
|
(let [length (count s)]
|
||||||
(->> (for [r [(dec row-idx) row-idx (inc row-idx)]
|
(->> (for [r [(dec row-idx) row-idx (inc row-idx)]
|
||||||
c (range (dec col-idx) (+ col-idx length 1))]
|
c (range (dec col-idx) (+ col-idx length 1))]
|
||||||
@ -51,7 +51,7 @@
|
|||||||
(filter seq)
|
(filter seq)
|
||||||
(mapcat identity)
|
(mapcat identity)
|
||||||
(map #(vector (ffirst %) (second %))))
|
(map #(vector (ffirst %) (second %))))
|
||||||
cogs (->> data
|
gear (->> data
|
||||||
(map first)
|
(map first)
|
||||||
(frequencies)
|
(frequencies)
|
||||||
(filter #(= (second %) 2))
|
(filter #(= (second %) 2))
|
||||||
@ -59,7 +59,7 @@
|
|||||||
(into #{}))]
|
(into #{}))]
|
||||||
(->> data
|
(->> data
|
||||||
(group-by first)
|
(group-by first)
|
||||||
(filter #(cogs (first %)))
|
(filter #(gear (first %)))
|
||||||
(map #(update % 1 (partial map second)))
|
(map #(update % 1 (partial map second)))
|
||||||
(map second)
|
(map second)
|
||||||
(map (partial map #(Integer/parseInt %)))
|
(map (partial map #(Integer/parseInt %)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user