Input:
[[a,b,c],
[d,e,],
[f,g,h]
]
Desired output:
[
[a,d,f],[a,d,g],[a,d,h],.......[c,e,h]
].
How would you do this in Scala?
Edit: The size of the individual list containing each letter, and the size of the list containing the list, is random. The lists containing letter can have different sizes