I want to be able to find whether all elements in list1 exist in list2, both lists containing chars. The number of times the same element appears in each list is important.
I tried using subsets however that didn't take note of the number of times an item appeared in a list
e.g.
list1 = [a, b, c]
list2 = [a, b, c, b]
It would find list2 a subset of list1, whereas I would only want my function to execute if:
list1 = [a, b, c, b, i]
list2 = [a, c, b, b]
as this means all items in list2 appear in list1.
If anyone was interested, using a counter was inefficient for large strings so I ended up adding all elements of list1 to a dictionary, with the values being number of occurances of each element and subtracted all elements of list2. If any values ended up negative not all items in list2 appear in list1