ajmorgan
6/7/2014 - 6:46 AM

sort cols before playing with them

sort cols before playing with them

(defn smallest-common [& cols]
  (let [sorted (sort-by first cols)]
    (if (apply = (map first sorted))
      (ffirst sorted)
      (apply smallest-common (cons (rest (first sorted)) (rest sorted))))))