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
0b7a626a04
commit
c48053fb3a
@ -104,22 +104,17 @@
|
||||
(map #(update % 1 (partial map second)))
|
||||
(map #(update % 1 sort))
|
||||
(into {}))
|
||||
by-col (->> path
|
||||
(group-by second)
|
||||
(map #(update % 1 (partial map first)))
|
||||
(map #(update % 1 sort))
|
||||
(into {}))
|
||||
coords (->> char-map
|
||||
(map first)
|
||||
(filter (comp not path)))]
|
||||
(->> coords
|
||||
(filter (fn [[row col]]
|
||||
(or (->> row
|
||||
by-row
|
||||
(partition 2)
|
||||
(some #(< (first %) col (second %))))
|
||||
(->> col
|
||||
by-col
|
||||
(partition 2)
|
||||
(some #(< (first %) row (second %)))))))
|
||||
(->> row
|
||||
by-row
|
||||
(take-while #(> col %))
|
||||
(map #(char-map [row %]))
|
||||
(filter (pipe-out-types :up))
|
||||
(count)
|
||||
odd?)))
|
||||
count))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user