I have two lists of values
lst_a = [701221,310522,5272,8868,1168478,874766]
nested_lst_b = [[701221,310522,765272,12343],[8868,1168478,98023],[83645,5272],[63572,88765,22786]]
I want to check if every value in lst_a is in nested_lst_b and return the matched values
Expected outputs:
output = [[701221,310522],[8868,1168478],[5272],[]]
I wrote the coding below but it didn't get what I expected...
for x,y in zip(lst_a,nested_lst_b):
if x in y:
print(x,y)
>>>701221 [701221, 310522, 765272, 12343]
>>>5272 [83645, 5272]
Can anyone help me with the problem? Thanks so much