Given a dict as input, the output should look as below(keys with common elements must be grouped). I have been trying to use groupby to get this done, but, I am not able to figure it out. Can you guys please help? groupby documentation is a bit difficult to understand for me.
input = {'c1': ['f1', 'f2', 'f3'],
'c2': ['f2'],
'c3': ['f4'],
'c4': ['f5', 'f4'],
'c5': ['f3'],
'c6': ['f6']}
output = [['c1', 'c2', 'c5'], ['c3', 'c4'], ['c6']]