I have two nested lists, each nested list containing two strings e.g.:
list 1 [('EFG', '[3,4,5]'), ('DEF', '[2,3,4]')] and list 2 [('DEF', '[2,3,4]'), ('FGH', '[4,5,6]')]
I would like to compare the two lists and recover those nested lists which are identical with each other. In this case only ('DEF','[2,3,4]')
would be returned. The lists could get long. Is there an efficient way to do this?