Skip to content

Instantly share code, notes, and snippets.

@mihneadb
Created December 17, 2012 13:24
Show Gist options
  • Save mihneadb/4318257 to your computer and use it in GitHub Desktop.
Save mihneadb/4318257 to your computer and use it in GitHub Desktop.
Hamming distance in Clojure
user=> (def x "AAAABCDBC")
#'user/x
user=> (def y "AABBBCCBC")
#'user/y
user=> (count (filter true? (map (partial reduce not=) (map vector x y))))
3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment