Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(defn freq-map
"Optimized version of the frequency map"
[coll]
(let [freqs (java.util.HashMap.)]
(doseq [val coll]
(.put freqs val (inc (get freqs val 0))))
freqs))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.