Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2014
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. let rec extract k l =
  2. match l with
  3. | [] -> []
  4. | h :: t ->
  5. if k = 1 then List.map (fun x -> [x]) (h :: t) else
  6. (List.map (fun x -> h :: x) (extract (k - 1) t))@(extract k t);;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement