Skip to content

Instantly share code, notes, and snippets.

View duncanjbrown's full-sized avatar
🍃

Duncan Brown duncanjbrown

🍃
View GitHub Profile
(def nums (take 100 (repeatedly (partial rand-int 10))))
(->> nums
(map-indexed vector)
(partition-by second)
(map (juxt (comp second first) (partial map first)))
(map (fn [[num indexes]]
(let [bounds (distinct ((juxt first last) indexes))]
(str (clojure.string/join "-" bounds) ": " (apply str (repeat num "#"))))))
(run! println))