Created
January 12, 2016 02:17
-
-
Save lnds/84b556795321b21480c4 to your computer and use it in GitHub Desktop.
Toque y fama en F#
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 comparar num sec = | |
let rec tyf ns xs ys = | |
match (ns, xs, ys) with | |
| ([], _, _) -> (0,0) | |
| (n::ns, x::xs, ys) -> | |
let (t,f) = tyf ns xs ys | |
if n = x then (t,f+1) else (if List.exists (fun x -> x = n) ys then (t+1,f) else (t,f)) | |
tyf num sec sec |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment