please say me how can i sub list common elements and index from a list of elements
You could try to use group by key