I have a list of sublists. I need all possible pairs between the elements in the sublists. For example, for a list like this:
a=[[1,2,3],[4,5],[6]]
The result should be:
result=[[1,4], [1,5], [1,6], [2,4], [2,5], [2,6], [3,4], [3,5], [3,6], [4,6], [5,6]]
The lists (and sublists) are of various, random lengths.