Skip to content

Instantly share code, notes, and snippets.

@j1n3l0
Created April 9, 2013 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save j1n3l0/5346393 to your computer and use it in GitHub Desktop.
Save j1n3l0/5346393 to your computer and use it in GitHub Desktop.
(use '[clojure.set :only [superset?]])
(map
(fn [coll]
(let [n (apply max coll)
ns (set (filter (partial > n) coll))
ds (set (map #(Math/abs %) (map #(apply - %) (partition 2 1 coll))))]
(superset? ns ds)))
[[1 4 2 3] [1 4 2 -1 6] [789 788 787] [1 2] [33 33 33 33] [12 13 15 18]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment