Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
(defn freq-map
"Optimized version of the frequency map"
(let [freqs (java.util.HashMap.)]
(doseq [val coll]
(.put freqs val (inc (get freqs val 0))))
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.