Skip to content

Instantly share code, notes, and snippets.

@lnds
Created January 12, 2016 02:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lnds/84b556795321b21480c4 to your computer and use it in GitHub Desktop.
Save lnds/84b556795321b21480c4 to your computer and use it in GitHub Desktop.
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