Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.28 KB | None | 0 0
  1. module Hamming
  2.  
  3. let distance (strand1: string) (strand2: string): int option =
  4.     match strand1.Length = strand2.Length with
  5.     | true ->
  6.         Seq.zip strand1 strand2 |>
  7.         Seq.filter (fun (x, y) -> x <> y) |>
  8.         Seq.length |>
  9.         Some
  10.     | false -> None
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement