How to get a set of elements in a list based on the index of an element in Scala?
I have one list and the other list contains the index I am interested in. For example,
val a=List("a","b","c","d")
val b=List(2,3)
Then I need to return a list with the value List ("b", "c"), since List (2,3) said I like to take the 2nd and 3rd elements from element "a". How to do it?
+3
source to share