On Wed, Jun 13, 2012 at 4:05 AM, JuanManuel Gimeno Illa <jmgim...@gmail.com> wrote: > My solution: > > (defn lis [s] > (->> s > (partition 2 1) > (partition-by (partial apply <=)) > (filter (fn [[[a b]]] (< a b))) > (reduce (fn [m s] (if (> (count s) (count m)) s m)) []) > (#(cons (ffirst %) (map second %)))))
nice trick with "(partition 2 1)" , The [n step coll] version of partition is quite powerful. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en