Advertisement
zzloss

Untitled

May 8th, 2019
1,071
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.24 KB | None | 0 0
  1. let dvamax l =
  2.     let rec aux e1 e2 l =
  3.     ( match l with
  4.     | [x] -> if(x > e1) then (x,e1) else if (x > e2) then (e1, x) else (e1,e2)
  5.     | h::t -> if(h > e1) then aux h e1 l else if (h > e2) then aux e1 h l else aux e1 e2 l
  6.     )
  7.     in aux 0 0 l;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement