Skip to content

Instantly share code, notes, and snippets.

View elevator-stops-problem.clj
(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)))
You can’t perform that action at this time.