File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change
1
+ ^:kindly/hide-code
1
2
(ns y2024.d06
2
3
(:require
3
4
[advent-of-code-clj.input :as input]
Original file line number Diff line number Diff line change @@ -79,7 +79,10 @@ MMMISSJEEE")
79
79
:kindly/hide-code true }
80
80
[:pre
81
81
(with-out-str
82
- (mx/pm test-matrix))]
82
+ (mx/pm (mx/emap (fn [sym]
83
+ (if (= \C sym)
84
+ \C \.))
85
+ test-matrix)))]
83
86
84
87
; Å finne alle regioner gjøres ved å undersøke alle noder i matrisen,
85
88
; finne hele regionen noden tilhører. Vi unngår å finne samme region
@@ -107,8 +110,7 @@ MMMISSJEEE")
107
110
^{:nextjournal.clerk/visibility {:result :hide }}
108
111
(defn open-sides [node-set node]
109
112
(->> node
110
- (apply utils/adjacent-hv)
111
- (remove node-set)
113
+ (find-neighbours (complement node-set))
112
114
count))
113
115
114
116
^{:nextjournal.clerk/visibility {:result :hide }}
@@ -224,6 +226,5 @@ AAAAAA")
224
226
225
227
(part-2 test-input-part-2)
226
228
227
- (time
228
- (part-2 (input/get-input 2024 12 )))
229
+ (part-2 (input/get-input 2024 12 ))
229
230
You can’t perform that action at this time.
0 commit comments