Created
January 9, 2018 08:31
-
-
Save usametov/60abf28a1bdae4ee2707086e6228f495 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Hamming | |
let distance (strand1: string) (strand2: string): int option = | |
if strand1.Length = strand2.Length | |
then | |
Some(Seq.zip strand1 strand2 |> Seq.sumBy (fun (a, b) -> if a = b then 0; else 1)) | |
else None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment