擅长:python、mysql、java
<pre><code>from collections import Counter
def is_contained(a,b):
aCount = Counter(a)
bCount = Counter(b)
return all(aCount[x] >= bCount[x] for x in bCount)
>>> is_contained([1, 1, 2, 4],[1, 2, 3])
False
>>> is_contained([1, 1, 2, 3], [1, 2, 3])
True
>>> is_contained([1, 2, 4], [1, 2, 1])
False
</code></pre>