Skip to content

Instantly share code, notes, and snippets.

(defn v->m [pers]
"Helper to quickly create persons maps"
(mapv (fn [v] {:weight (first v), :floor (second v)}) pers))
(defn nextv [v]
"Cheating next that returns vector"
(subvec v 1))
(defn total-weight [elevator]
(reduce + (map :weight elevator)))