1
I am grouping lists within list together given they have one element in common.
My input data is
[[1, 2], [3, 4], [5, 6], [1, 2, 7], [8, 2], [9, 5]]
My output is:
[[1, 2], [1, 2, 7], [8, 2], [3, 4], [5, 6], [9, 5]]
The code I am using to accomplish this is:
mylist = [[1, 2], [3, 4], [5, 6], [1,...