Skip to content

Instantly share code, notes, and snippets.

@msszczep
Created May 4, 2018
Embed
What would you like to do?
letters->numbers in Clojure
(defn letters->numbers [letters]
(let [letter-map (zipmap (map char "abcdefghijklmnopqrstuvwxyz")
(range 1 27))]
(->> letters
(map char)
(map letter-map)
(reduce +))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment