Skip to content

Instantly share code, notes, and snippets.

View catharinejm's full-sized avatar
🐶

Catharine Manning catharinejm

🐶
View GitHub Profile
(defn pairs-seq [m]
(->> (keys m)
(mapcat #(partition 2 (interleave (repeat %) (get m %))))))
(defn subset [m n]
(reduce #(update-in %1 [(first %2)] (fnil conj []) (second %2)) {}
(take n (pairs-seq m))))
(def m1 {:x [1 2] :y [3 4] :z [5]})