Create a gist now

Instantly share code, notes, and snippets.

@lnds /tyf.fs
Created Jan 12, 2016

Toque y fama en F#
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