How do I append this list:
val aList = List(List(8),List(7),List(6),List(4),List(9))
based on:
val aUpdate = List(8,7,4,2,9)
and the output should be:
val aList = List(List(8,8), List(7,7),List(6),List(4),List(9,9))
I had expected the following code to work:
val aList = for (i <- 1 to 4) aList map (_(i)) {
case if aList map (_(i)) contains aUpdate(i) => ++ List(map.aUpdate(i))
Anyone could tell me what is the valid argument for the output? and please explain the detail how it works.