Suppose my input is a list of lists:
[[1, 2], [3, 6], [1, 4], [3, 8]]
I need to get matches in the output, but not all in one list.
For example, 1 lies in the list [1, 2]
and also in the list [1, 4]
. I want to get [1, 2, 4]
and the same for 3.
That is, the result should be something like:
(1, 2, 4)
(3, 6, 8)
Is it possible?