Skip to content

Instantly share code, notes, and snippets.

@tomjack
Created July 27, 2011 03:28
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 tomjack/616f9601337786730d3e to your computer and use it in GitHub Desktop.
Save tomjack/616f9601337786730d3e to your computer and use it in GitHub Desktop.
user> (let [v ["foo" "foo" "bar" "foo" "baz" "bing" "bing" "foo" "bar"]]
(map (->> v set (map-indexed (fn [a b] [b a])) (into {})) v))
(1 1 2 1 3 0 0 1 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment