mirror of
https://github.com/Ajetski/advent-of-code.git
synced 2025-09-30 13:03:19 -09:00
golf
This commit is contained in:
parent
0b7a626a04
commit
c48053fb3a
@ -104,22 +104,17 @@
|
|||||||
(map #(update % 1 (partial map second)))
|
(map #(update % 1 (partial map second)))
|
||||||
(map #(update % 1 sort))
|
(map #(update % 1 sort))
|
||||||
(into {}))
|
(into {}))
|
||||||
by-col (->> path
|
|
||||||
(group-by second)
|
|
||||||
(map #(update % 1 (partial map first)))
|
|
||||||
(map #(update % 1 sort))
|
|
||||||
(into {}))
|
|
||||||
coords (->> char-map
|
coords (->> char-map
|
||||||
(map first)
|
(map first)
|
||||||
(filter (comp not path)))]
|
(filter (comp not path)))]
|
||||||
(->> coords
|
(->> coords
|
||||||
(filter (fn [[row col]]
|
(filter (fn [[row col]]
|
||||||
(or (->> row
|
(->> row
|
||||||
by-row
|
by-row
|
||||||
(partition 2)
|
(take-while #(> col %))
|
||||||
(some #(< (first %) col (second %))))
|
(map #(char-map [row %]))
|
||||||
(->> col
|
(filter (pipe-out-types :up))
|
||||||
by-col
|
(count)
|
||||||
(partition 2)
|
odd?)))
|
||||||
(some #(< (first %) row (second %)))))))
|
|
||||||
count))
|
count))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user