Skip to content

Instantly share code, notes, and snippets.

Created April 23, 2011 21:02
Show Gist options
  • Save anonymous/938975 to your computer and use it in GitHub Desktop.
Save anonymous/938975 to your computer and use it in GitHub Desktop.
;; amalloy's solution to http://4clojure.com/problem/53
(let [less (partial apply <)]
(fn [coll]
(if-let [pairs
(seq (->> coll
(partition 2 1)
(partition-by less)
(filter (comp less first))))]
(apply cons
((juxt ffirst
(partial map second))
(apply max-key count (reverse pairs))))
[])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment