Created
January 7, 2019 17:33
-
-
Save sslotsky/c96a9cd91380a0dd8217a41d11377cf0 to your computer and use it in GitHub Desktop.
This file contains 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
let percentCovered = (x, y) => { | |
let (x, y) = (min(x, y), max(x, y)); | |
let amountCovered = sites^ |> List.fold_left((sum, site) => { | |
sum +. (min(site.right, y) -. max(site.left, x)) | |
}, 0.0); | |
100.0 *. amountCovered /. (y -. x); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment