Skip to content

Instantly share code, notes, and snippets.

Created March 31, 2012 07:34
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/2260503 to your computer and use it in GitHub Desktop.
Save anonymous/2260503 to your computer and use it in GitHub Desktop.
;; ariarule's solution to Pairwise Disjoint Sets
;; https://4clojure.com/problem/153
(fn [s]
(every? #(< % 2)
(map
#(reduce
(fn [n x]
(if (not (= 0 x))
(inc n)
n))
0
%)
(map
#(map
(fn [x] (count (clojure.set/intersection x %)))
s)
s))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment