Skip to content

Instantly share code, notes, and snippets.

@worldofchris
Created May 7, 2013 10:57
Show Gist options
  • Save worldofchris/5531815 to your computer and use it in GitHub Desktop.
Save worldofchris/5531815 to your computer and use it in GitHub Desktop.
Column problem
(def input [[1,2,3],[1,3,4],[1,5,6]])
(defn is-list-unique [input]
"Takes a list and returns first element if they are all the same and sum of elements if not"
(if (every? #{(first input)} (rest input))
(first input)
(apply + input))
)
(defn are-lists-unique [input]
(map is-list-unique (apply map list input))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment