You are given two string arrays words1 and words2. A string w in words1 is called a universal word if, for every string b in words2, b is a subset of w in terms of character counts. In other words, for each lowercase letter, w must contain that letter at least as many times as it appears in b.
Return all strings in words1 that are universal with respect to words2.
Constraints:
words1.length, words2.length
words1[i].length, words2[i].length
words1[i] and words2[i] consist only of lowercase English letters
All strings in words1 are unique
You are given two string arrays words1 and words2. A string w in words1 is called a universal word if, for every string b in words2, b is a subset of w in terms of character counts. In other words, for each lowercase letter, w must contain that letter at least as many times as it appears in b.
Return all strings in words1 that are universal with respect to words2.
Constraints:
words1.length, words2.length
words1[i].length, words2[i].length
words1[i] and words2[i] consist only of lowercase English letters
All strings in words1 are unique