How to get the sublist with the maximum length within a list?
I have this codes:
c = [1,2]
a = [[1,2], [3,4], [3,2]]
for b in a:
g = len(list(set(b) - set(c))) *#list of difference items between c and b in a*
print(g)
result
0
2
1
I need to get b in a with the longest length >> g = 2
I used
y = [b for b in a if max (g)]
TypeError: 'int' object is not iterable
Thank you,