Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let rec isPart (l1,l2) =
- if l1 = [] && l2 <> [] then false
- else if l2 = [] then true
- else if List.hd l1 <> List.hd l2 then isPart(List.tl l1, l2)
- else if List.hd l1 = List.hd l2 then isPart(List.tl l1, List.tl l2)
- else false
- ;;
- isPart ([1;2;3;4;5;6;7;8;9],[3;4;5]);;
- isPart ([1;2;3;4;5;6;7;8;9],[8;8]);;
- isPart ([1;2;3;4;5;6;7;8;9],[]);;
- isPart ([],[]);;
Add Comment
Please, Sign In to add comment