how to create combinations of elements in a list in scala

Viewed 3364

I have a rdd of list of strings, like the following:

 (['a','b','c'],['1','2','3','4'],['e','f'],...)

now I want to get the list consists of all pairwise combinations in each innerlist, like the following:

 (('a','b'),('a','c'),('b','c'),('1','2'),('1','3'),('1','4'),('2','3'),'('2','4'),('3','4'),('e','f'),...)

How to do that?

1 Answers
Related