Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def matchTwoLists(xs:List[Int], ls: List[Int]): List[Int] = {
- (xs, ls) match {
- case (Nil, Nil) => Nil
- case (head::tail, Nil) => head :: matchTwoLists(tail, Nil)
- case (Nil, head1::tail1) => head1 :: matchTwoLists(Nil, tail1)
- case (head::tail, head1::tail1) => head :: head1 :: matchTwoLists(tail, tail1)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement