maxFreq
to store the maximum frequency of each letter from words2
.words2
, update maxFreq
with the maximum frequency of each letter.result
to store the universal strings.words1
, create a frequency map wordFreq
.wordFreq
with maxFreq
to check if the current word is a universal string.result
.result
list.