Advertisement
Guest User

Untitled

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