How to search for common values in a 2 dimensional list and a simple list? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to search for common values in a 2 dimensional list and a simple list?

A = [2,7,85,4] B = [[1,33,6],[3,5,7,6],[1,85,77]] The idea is to see which numbers are common in those two lists and how many, if you also could explain how to search for common values in 2 two dimensional lists that would be awesome. Meaning: A = [[…..],[…..],[….]] B = [[…..],[….],[…..]]

8th Feb 2022, 2:17 PM
Lenoname
2 Answers
+ 5
Flatten the list
8th Feb 2022, 2:57 PM
Oma Falk
Oma Falk - avatar
0
Oma Falk actually the list shouldnt be flattened,i need to know how many common values each sublist in B has in common with the A list.
8th Feb 2022, 7:03 PM
Lenoname