Skip to content

Instantly share code, notes, and snippets.

@trikitrok
Last active June 30, 2024 14:39
Show Gist options
  • Save trikitrok/6f77b18ca7f1fec4c65e to your computer and use it in GitHub Desktop.
Save trikitrok/6f77b18ca7f1fec4c65e to your computer and use it in GitHub Desktop.
(ns dna)
(defn hamming-distance [strand1 strand2]
(reduce
+
(map
(fn [base1 base2]
(if (= base1 base2) 0 1))
strand1
strand2)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment