Skip to content

Instantly share code, notes, and snippets.



Last active Jun 21, 2016
What would you like to do?
(defn remove-one [item list]
(let [[n m] (split-with (partial not= item) list)] (vec (concat n (rest m)))))
(defn sorting-sort [unsorted]
(loop [inner-unsorted unsorted sorted []]
(let [min-val (apply min inner-unsorted)]
(= 1 (count inner-unsorted))
(empty? inner-unsorted))
(recur (remove-one min-val inner-unsorted) (conj sorted min-val))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment