Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let rec extract k l =
- match l with
- | [] -> []
- | h :: t ->
- if k = 1 then List.map (fun x -> [x]) (h :: t) else
- (List.map (fun x -> h :: x) (extract (k - 1) t))@(extract k t);;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement