Skip to content

Instantly share code, notes, and snippets.

@uvtc
Created June 28, 2012 20:04
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 uvtc/3013575 to your computer and use it in GitHub Desktop.
Save uvtc/3013575 to your computer and use it in GitHub Desktop.
(ns zow.core)
(def maps [{:a 1 :b 2}
{:a 11 :b 22 :c 5}
{:c 6 :a 7}])
(defn my-merge-maps
[maps]
(apply merge-with
(fn [curr-val new-val]
(if (set? curr-val)
(conj curr-val new-val)
#{curr-val new-val}))
maps))
(defn -main
[]
(println (my-merge-maps maps)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment