Skip to content

Instantly share code, notes, and snippets.

Created December 8, 2011 06:33
Show Gist options
  • Save anonymous/1446289 to your computer and use it in GitHub Desktop.
Save anonymous/1446289 to your computer and use it in GitHub Desktop.
;; flengyel's solution to Black Box Testing
;; https://4clojure.com/problem/65
(fn blackbox [s]
(cond
(= (conj s {}) s) :map
(empty? s) (cond
(= (clojure.set/union s #{}) #{}) :set
(= (conj (conj s 0) 1) [0 1]) :vector
:else :list)
(= (clojure.set/union s s) s) :set
(= (first (conj s s)) s) :list
:else :vector))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment