I’m trying to fetch value in nested lists in Scala but somehow I’m not able to find a solution.
I’ve created a list as:
var list3 = List((1,2,3),(4,5,6),(7,8),(9,10,11,12))
I want 7 as the output.
In python, for the same thing, I’m creating list as
list3 = [[1,2,3],[4,5,6],[7,8],[9,10,11,12]]
To get the output as 7, I’m using
list3[len(list3) -2][len(list3) -4]
Please suggest me how to achieve the same in Scala.
Thanks in advance.