Skip to content

Commit 0b927ec

Browse files
committed
Cleanup
1 parent df06adb commit 0b927ec

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

notebooks/y2024/d06.clj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
^:kindly/hide-code
12
(ns y2024.d06
23
(:require
34
[advent-of-code-clj.input :as input]

notebooks/y2024/d12.clj

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ MMMISSJEEE")
7979
:kindly/hide-code true}
8080
[:pre
8181
(with-out-str
82-
(mx/pm test-matrix))]
82+
(mx/pm (mx/emap (fn [sym]
83+
(if (= \C sym)
84+
\C \.))
85+
test-matrix)))]
8386

8487
; Å finne alle regioner gjøres ved å undersøke alle noder i matrisen,
8588
; finne hele regionen noden tilhører. Vi unngår å finne samme region
@@ -107,8 +110,7 @@ MMMISSJEEE")
107110
^{:nextjournal.clerk/visibility {:result :hide}}
108111
(defn open-sides [node-set node]
109112
(->> node
110-
(apply utils/adjacent-hv)
111-
(remove node-set)
113+
(find-neighbours (complement node-set))
112114
count))
113115

114116
^{:nextjournal.clerk/visibility {:result :hide}}
@@ -224,6 +226,5 @@ AAAAAA")
224226

225227
(part-2 test-input-part-2)
226228

227-
(time
228-
(part-2 (input/get-input 2024 12)))
229+
(part-2 (input/get-input 2024 12))
229230

0 commit comments

Comments
 (0)