| What would be the output of the following code snippet?
val s = List (10, 11, 12)
val result = s.flatMap(i => List(i-1, i, i +1))
println(result)
Choose the correct options from below list
(1)List(9, 10, 10, 11, 10, 12, 12, 11, 13)
(2)List(List(9,10,11), List(10,11,12), List(11,12,13))
(3)None of the options
(4)List(9, 10, 11, 10, 11, 12, 11, 12, 13)
Answer:-(1)List(9, 10, 10, 11, 10, 12, 12, 11, 13) | | |