Created
May 7, 2013 10:57
-
-
Save worldofchris/5531815 to your computer and use it in GitHub Desktop.
Column problem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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