Skip to content

Instantly share code, notes, and snippets.

@podhmo
Created August 18, 2010 12:25
Show Gist options
  • Save podhmo/534527 to your computer and use it in GitHub Desktop.
Save podhmo/534527 to your computer and use it in GitHub Desktop.
(defn overlap [coll]
(->> coll
(reduce (fn [m x]
(assoc m x (+ 1 (get m x 0))))
{})
(filter (fn [[_ i]] (> i 1)))
(map first)))
(map (fn [x] x) (overlap [3 1 4 1 5 9 2 6 5 3 5 8 9]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment