Created
May 28, 2015 09:08
-
-
Save lsgrep/67bdc5f3a434a4c34de4 to your computer and use it in GitHub Desktop.
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
(fn lazy-search | |
"elegant as fuck, http://www.4clojure.com/problem/108" | |
[& x] | |
(let [[[b & e] & c] (sort-by first x)] | |
(if (apply = (map first x)) | |
b | |
(apply lazy-search (conj c e))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment