On Thu, Dec 06, 2012 at 08:40:09AM -0800, halheinrich wrote:
> What code will multiply those two together to arrive at:
>
> val l3: List[Int] = List(4, 10, 18)
Consider:
val ns1 = 1 :: 2 :: 3 :: Nil
val ns2 = 2 :: 4 :: 6 :: Nil
ns1.zip(ns).map { case (a, b) => a * b }
// res0: List[Int] = List(2, 8, 18)
Hope this helps!
-- Erik