I have a nested list:
lists =[['a','b','c'],
['a','b','d'],
['a','b','e'],
['с','с','с','с']]
I need to find sublists with 2 or more common (2 or more occurrences) first elements, make a single string from this elements, and make a single string from sublists, which does not contain common first elements. Sublists can go in different order, so just checking next or previous element is the wrong way, I suppose. Desired output:
[['a b','c'],
['a b','d'],
['a b','e'],
['с с с с']]
I tried some for loops, but with no success. I currently don't know, where to start, so any help would be appreciated. Thank you for your time!