a = [{lang: 'english', count: 15}, {lang: 'spanish', count: 25}]
b = ['spanish', 'english']
I would like to check if the items in b list appears in a - list of dicts. (specifically in lang key).
if we have a match as we have in my example (both of b list items appears in a list of dicts), I would like to return a new list of dict with only the item that have the max count.
For this example:
[{lang: 'spanish', count: 25}]
Can you please help me with this? Thanks!