Implement scala zipper method
Anónimo
def zip(ls1: List[Int], ls2: List[String]): List[(Int, String)] = { def fun(ls1: List[Int], ls2: List[String], res: List[(Int, String)]): List[(Int, String)] = (ls1, ls2) match { case (Nil, _) => res case (_, Nil) => res case (p::q,r::s) => (fun(q,s, res :+ (p,r))) } fun(ls1, ls2, List[(Int, String)]()) }