Skip to content

Instantly share code, notes, and snippets.

Created March 15, 2012 12:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/2043970 to your computer and use it in GitHub Desktop.
Save anonymous/2043970 to your computer and use it in GitHub Desktop.
;; ariarule's solution to Lazy Searching
;; https://4clojure.com/problem/108
(fn [l & ls]
(let [lz (conj ls l)]
(first
(filter identity
(map
(fn [ocl] (reduce #(and %1 %2) true ocl))
(map
#(map
(fn [cl]
(some (fn [x] (#{x} %)) (take-while (fn [cn] (< cn (inc %))) cl)))
lz)
l))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment